-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiscord_bot.py
More file actions
79 lines (60 loc) · 2.87 KB
/
discord_bot.py
File metadata and controls
79 lines (60 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import os
from get_messages import check_for_messages, chatid, last_message, typeOfChat, message_id, message_sender
from send_based_message import send_based_message
from BasedBot import BasedBot
from wrappers import command
import time
import nextcord
from nextcord import Interaction, SlashOption, Webhook
from nextcord.ui import Button, View
from nextcord.ext import commands
intents = nextcord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents)
TOKEN=os.environ["TOKEN"]
sender = ""
basedBot = BasedBot()
@bot.event
async def on_ready():
print("bot running ser")
# @ctx.slash_command(name="send", description="Send your message to sellected group")
# async def send(interaction: Interaction, receiver: str = SlashOption(description="Who you want to send to", required=True), type: str = SlashOption(description="groups/users", required=True), message: str = SlashOption(description="The message you want to send", required=True)):
@bot.slash_command(name="sendbased",
description="Send your message to selected group")
async def sendbased(interaction: Interaction,
message,
receiver=SlashOption(name="receiver",
choices={
"kriyos": "kriyos",
"md20m": "md20m",
'moss': 'moss'
}),
type=SlashOption(name="type",
choices={
"user": "user",
"group": "group"
})):
basedBot.send(type, receiver, message)
sentConfirmation = nextcord.Embed(title=f"You sent a message to {receiver}",
description=message,
colour=0x00ff00)
await interaction.send(embed=sentConfirmation)
@bot.slash_command(name="ping",
description="Send your message to selected group")
async def ping(interaction: Interaction):
await interaction.send("pong")
@bot.slash_command(name="createwebhook", description="Self explanatory")
async def createwebhook(interaction: Interaction):
webhook = await interaction.channel.create_webhook(name='Test Webhook')
print(f'Webhook URL: {webhook.url}')
# @bot.slash_command(name="pfp", description="Get pfp")
# async def createwebhook(interaction: Interaction):
# await interaction.send(basedBot.message_sender_pfp("kriyos"))
@bot.slash_command(name="channel",
description="create channel if moss still dont give perm")
async def channel(interaction: Interaction, name):
guild = interaction.guild
await interaction.send("<@949737170896314469>")
await guild.create_text_channel(name=f"{name}")
print("_")
bot.run(
"TOKEN")