For some reason my bot does not see the command, although it is registered by the decorator
from loguru import logger
logger.add('debug.json',
format='{time:YYYY-MM-DD at HH:mm:ss} | {level} | {message}',
level='DEBUG',
rotation='250MB',
compression='zip',
serialize=True)
import disnake
from disnake.ext import commands
from config import settings
from cogs.commands.info import InfoCommand
INTENTS = disnake.Intents.all()
class TeamBot(commands.Bot):
@logger.catch
def __init__(self):
super().__init__(intents=INTENTS,
reload=True,
help_command=None,
command_prefix=settings.PREFIX_COMMAND_BOT,
command_sync_flags=commands.CommandSyncFlags.all())
if __name__ == "__main__":
bot = TeamBot()
bot.add_cog(InfoCommand(bot))
bot.run(settings.TOKEN_BOT)
import disnake
from disnake.ext import commands
from loguru import logger
class InfoCommand(commands.Cog):
def __init__(self, bot):
self._bot = bot
logger.info(f'Cog "{__name__}" loaded.')
@logger.catch
@commands.command(name="info", description="Get info about a command.")
async def info(self, ctx):
await ctx.send('info')
Ignoring exception in command None:
disnake.ext.commands.errors.CommandNotFound: Command "info" is not found