30 lines
650 B
Python
30 lines
650 B
Python
import discord
|
|
from discord.ext import commands
|
|
|
|
from config import Config
|
|
|
|
|
|
class MyBot(commands.Bot):
|
|
def __init__(self, config: Config):
|
|
intents = discord.Intents.default()
|
|
intents.message_content = True
|
|
intents.members = True
|
|
|
|
super().__init__(command_prefix=config.BOT.prefix, intents=intents)
|
|
self.config: Config = config
|
|
|
|
super().run(self.config.BOT.token)
|
|
|
|
async def setup_hook(self) -> None:
|
|
modules = [
|
|
"modules.youtrackIntegration",
|
|
"modules.TMC"
|
|
]
|
|
for module in modules:
|
|
await self.load_extension(module)
|
|
|
|
return await super().setup_hook()
|
|
|
|
async def on_ready(self):
|
|
print(f'Bot started as {self.user}')
|