lenaverse-bot/lenaverse_bot/core/bot.py

29 lines
766 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 15:27:10 +00:00
from .commands import lsstuff
2023-11-19 22:37:51 +00:00
from .post import ev_post
2023-11-19 23:26:23 +00:00
from .verein import ev_join, ev_linktree
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 22:37:51 +00:00
self.tree.add_command(ev_post)
2023-11-19 23:26:23 +00:00
self.tree.add_command(ev_join)
self.tree.add_command(ev_linktree)
2023-11-18 21:27:30 +00:00
self.tree.add_command(lsstuff)
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!")