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

29 lines
677 B
Python

import logging
import discord
from .commands import lsstuff
from .post import post
_logger = logging.getLogger(__name__)
class LenaverseBot(discord.Client):
def __init__(self) -> None:
intents = discord.Intents.default()
super().__init__(intents=intents)
self.tree = discord.app_commands.CommandTree(self)
self.tree.add_command(post)
self.tree.add_command(lsstuff)
async def setup_hook(self):
await self.tree.sync()
_logger.info("Commands synced")
async def on_ready(self) -> None:
if self.user is None:
return
_logger.info(f"{self.user.name} has connected to Discord!")