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

32 lines
789 B
Python

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