Added slash command support

This commit is contained in:
2022-09-11 10:21:28 +02:00
parent 92ed684866
commit 85c5b26fdf
4 changed files with 9 additions and 3 deletions

View File

@@ -72,5 +72,8 @@ class DiscordBotService(DiscordBotServiceABC):
Console.banner(self._env.application_name if self._env.application_name != '' else 'A bot')
await self._discord_service.init(self)
await self.wait_until_ready()
await self.tree.sync()
self._logger.debug(__name__, f'Finished syncing commands')
await self._discord_service.on_ready()

View File

@@ -3,7 +3,7 @@ from typing import Optional, Sequence, Union, Type
import discord
from discord.ext import commands
from discord.ext.commands import Context, CommandError, Cog
from discord.ext.commands import Context, CommandError, Cog, Command
from cpl_core.dependency_injection import ServiceProviderABC
from cpl_core.logging import LoggerABC