diff --git a/lenaverse_bot/core/bot.py b/lenaverse_bot/core/bot.py index 3b6385a..e06a1ba 100644 --- a/lenaverse_bot/core/bot.py +++ b/lenaverse_bot/core/bot.py @@ -2,9 +2,8 @@ import logging import discord +from . import post, verein from .commands import lsstuff -from .post import ev_post -from .verein import ev_join, ev_linktree _logger = logging.getLogger(__name__) @@ -14,11 +13,12 @@ class LenaverseBot(discord.Client): super().__init__(intents=discord.Intents.default()) self.tree = discord.app_commands.CommandTree(self) - self.tree.add_command(ev_post) - self.tree.add_command(ev_join) - self.tree.add_command(ev_linktree) self.tree.add_command(lsstuff) + 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") diff --git a/lenaverse_bot/core/post.py b/lenaverse_bot/core/post.py index fd532aa..b45c5e6 100644 --- a/lenaverse_bot/core/post.py +++ b/lenaverse_bot/core/post.py @@ -114,3 +114,8 @@ async def ev_post(interaction: discord.Interaction) -> None: # nur für ausführenden User ephemeral=True, ) + + +COMMANDS = [ + ev_post, +] diff --git a/lenaverse_bot/core/verein.py b/lenaverse_bot/core/verein.py index ad8d472..76f57b4 100644 --- a/lenaverse_bot/core/verein.py +++ b/lenaverse_bot/core/verein.py @@ -38,3 +38,9 @@ async def ev_join(interaction: discord.Interaction) -> None: content=CONFIG.ev_info.join_message.strip(), file=discord.File(get_files_path() / CONFIG.ev_info.join_file), ) + + +COMMANDS = [ + ev_linktree, + ev_join, +]