forked from Phxntxm/Tanya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py
38 lines (27 loc) · 895 Bytes
/
bot.py
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
import discord
from discord.ext import commands
from glob import glob
import config
intents = discord.Intents(
guild_messages=True,
guild_reactions=True,
guilds=True,
)
class Bot(commands.Bot):
error_channel = 840770815498649660
async def get_context(self, message, *, cls=commands.Context):
if hasattr(self, "custom_context"):
return await super().get_context(message, cls=self.custom_context)
else:
return await super().get_context(message, cls=cls)
bot = Bot(
command_prefix=commands.when_mentioned_or(">>"),
intents=intents,
owner_ids=[115997555619266561, 204306127838642176],
help_command=commands.DefaultHelpCommand(
command_attrs={"name": "commands", "aliases": ["command"]}
),
)
for ext in glob("extensions/*.py"):
bot.load_extension(ext.replace("/", ".")[:-3])
bot.run(config.token)