-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.py
28 lines (20 loc) · 844 Bytes
/
main.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
from helper_utils.utils import bot_token
import discord
from discord.ext import commands
from cogs import COMMANDS, EVENT_HANDLERS
class CogBOT(commands.Bot):
def __init__(self, *args: any, **kwargs: any) -> None:
super().__init__(*args, **kwargs)
async def setup_hook(self) -> None:
for cog in COMMANDS:
cog_name = cog.split('.')[-1]
discord.client._log.info(f"Loaded Command {cog_name}")
await self.load_extension(f"{cog}")
for cog in EVENT_HANDLERS:
cog_name = cog.split('.')[-1]
discord.client._log.info(f"Loaded Event Handler {cog_name}")
await self.load_extension(f"{cog}")
intents = discord.Intents.default()
intents.message_content = True
bot = CogBOT(command_prefix="/", intents=intents)
bot.run(bot_token, reconnect=True)