move commands into package
This commit is contained in:
parent
4be2eaff1f
commit
491723fc3b
4 changed files with 7 additions and 5 deletions
3
lenaverse_bot/commands/__init__.py
Normal file
3
lenaverse_bot/commands/__init__.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from . import post, verein
|
||||||
|
|
||||||
|
COMMANDS = post.COMMANDS + verein.COMMANDS
|
|
@ -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__)
|
||||||
|
|
|
@ -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__)
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue