1
0
Fork 0
mirror of https://code.lenaisten.de/Lenaisten/lenaverse-bot.git synced 2024-11-22 23:13:01 +00:00
lenaverse-bot/lenaverse_bot/core/bot.py

26 lines
663 B
Python
Raw Normal View History

2023-11-17 09:53:10 +00:00
import logging
import discord
2023-11-17 10:49:50 +00:00
2023-11-19 23:43:50 +00:00
from . import post, verein
2023-11-17 09:53:10 +00:00
_logger = logging.getLogger(__name__)
2023-11-18 20:52:07 +00:00
class LenaverseBot(discord.Client):
2023-11-17 09:53:10 +00:00
def __init__(self) -> None:
2023-11-19 22:37:51 +00:00
super().__init__(intents=discord.Intents.default())
2023-11-17 09:53:10 +00:00
2023-11-18 20:52:07 +00:00
self.tree = discord.app_commands.CommandTree(self)
2023-11-19 23:43:50 +00:00
commands = post.COMMANDS + verein.COMMANDS
for command in commands:
self.tree.add_command(command)
2023-11-18 20:52:07 +00:00
async def setup_hook(self):
await self.tree.sync()
_logger.info("Commands synced")
2023-11-17 10:49:50 +00:00
2023-11-17 09:53:10 +00:00
async def on_ready(self) -> None:
2023-11-19 22:37:51 +00:00
assert self.user is not None
2023-11-17 09:53:10 +00:00
_logger.info(f"{self.user.name} has connected to Discord!")