-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbot.py
34 lines (28 loc) · 972 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
import discord
from discord.ext import commands
from typing import Any
'''
Cogs:
Using Cogs in Discord.py, instead of putting all the commands in one file,
we can consider a separate file for each command or group of commands with
the same function or sub-commands and load these files in the main source of our bot.
extentions:
In this version of the robot, we consider all the Cogs as a tuple called extentions and load this tuple.
'''
bot_extentions = (
'cogs.about.about',
'cogs.admin.channel',
'cogs.admin.clear',
'cogs.admin.role',
'cogs.admin.kick',
'cogs.admin.timeout',
'cogs.admin.announceEmbed',
'cogs.contact_forms.staff',
)
class MyBot(commands.Bot):
def __init__(self, *args: Any, **kwargs: Any):
super().__init__(*args, **kwargs)
async def setup_hook(self) -> None:
for extention in bot_extentions:
await self.load_extension(extention)
await self.tree.sync()