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

move commands into package

This commit is contained in:
Jörn-Michael Miehe 2023-12-02 23:56:11 +01:00
parent 4be2eaff1f
commit 491723fc3b
4 changed files with 7 additions and 5 deletions

View file

@ -0,0 +1,3 @@
from . import post, verein
COMMANDS = post.COMMANDS + verein.COMMANDS

View file

@ -4,7 +4,7 @@ from enum import Enum, auto
import discord import discord
from discord import ui from discord import ui
from .config import CONFIG from ..core.config import CONFIG
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)

View file

@ -3,7 +3,7 @@ import logging
import discord import discord
from .config import CONFIG, FileCommand, InfoCommand from ..core.config import CONFIG, FileCommand, InfoCommand
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)

View file

@ -2,7 +2,7 @@ import logging
import discord import discord
from . import post, verein from ..commands import COMMANDS
from .config import CONFIG from .config import CONFIG
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
@ -16,8 +16,7 @@ class LenaverseBot(discord.Client):
) )
self.tree = discord.app_commands.CommandTree(self) self.tree = discord.app_commands.CommandTree(self)
commands = post.COMMANDS + verein.COMMANDS for command in COMMANDS:
for command in commands:
self.tree.add_command(command) self.tree.add_command(command)
async def setup_hook(self): async def setup_hook(self):