lenaverse-bot/lenaverse_bot/core/bot.py
Jörn-Michael Miehe 876d8fe20a config rework, command_prefix, remove clutter
- _helpers.ev_command respects CONFIG.command_prefix
- restrict public replies to channel ids
2023-11-20 13:37:36 +01:00

25 lines
663 B
Python

import logging
import discord
from . import post, verein
_logger = logging.getLogger(__name__)
class LenaverseBot(discord.Client):
def __init__(self) -> None:
super().__init__(intents=discord.Intents.default())
self.tree = discord.app_commands.CommandTree(self)
commands = post.COMMANDS + verein.COMMANDS
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:
assert self.user is not None
_logger.info(f"{self.user.name} has connected to Discord!")