Release 2022.10 #112

Merged
edraft merged 51 commits from 2022.10 into master 2022-09-30 15:48:19 +02:00
4 changed files with 9 additions and 3 deletions
Showing only changes of commit 85c5b26fdf - Show all commits

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

View File

@ -20,7 +20,7 @@ class PingCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command()
@commands.hybrid_command()
async def ping(self, ctx: Context):
self._logger.debug(__name__, f'Received command ping {ctx}')
self._logger.info(__name__, f'Bot name {self._bot.user.name}')

View File

@ -20,9 +20,12 @@ class PurgeCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command()
@commands.hybrid_command()
async def purge(self, ctx: Context):
self._logger.debug(__name__, f'Received command ping {ctx}')
self._logger.info(__name__, f'Bot name {self._bot.user.name}')
self._logger.trace(__name__, f'Finished ping command')
await ctx.channel.purge()
if ctx.interaction is None:
return
await ctx.interaction.response.send_message('Purged this channel xD')