mirror of
https://code.lenaisten.de/Lenaisten/lenaverse-bot.git
synced 2024-11-21 22:43:01 +00:00
command lists
This commit is contained in:
parent
13dcddb135
commit
6cb7feddd2
3 changed files with 16 additions and 5 deletions
|
@ -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")
|
||||
|
|
|
@ -114,3 +114,8 @@ async def ev_post(interaction: discord.Interaction) -> None:
|
|||
# nur für ausführenden User
|
||||
ephemeral=True,
|
||||
)
|
||||
|
||||
|
||||
COMMANDS = [
|
||||
ev_post,
|
||||
]
|
||||
|
|
|
@ -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,
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue