Jintaku-Cogs-V3 icon indicating copy to clipboard operation
Jintaku-Cogs-V3 copied to clipboard

[Confessions] Exception in command 'confess'

Open Ryan5453 opened this issue 4 years ago • 1 comments

When running [p]confess in DMs with the bot when you don't have a server with a set channel, it generates this traceback

  File "/home/main/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/main/red/cogs/CogManager/cogs/confession/confession.py", line 90, in confess
    await menu(ctx, pages=embeds, controls=SELECT_CONTROLS, message=None, page=0, timeout=20)
  File "/home/main/redenv/lib/python3.8/site-packages/redbot/core/utils/menus.py", line 59, in menu
    if not isinstance(pages[0], (discord.Embed, str)):
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/main/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "/home/main/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 859, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/main/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range```

In DMs, the bot sends this

```No server with a confession room, ask your server owners to set it up!
Error in command 'confess'. Check your console or logs for details.```

Ryan5453 avatar Dec 04 '20 03:12 Ryan5453

Hmmm, sounds like a bug with https://github.com/Jintaku/Jintaku-Cogs-V3/blob/master/confession/confession.py#L71

I'll check it out later, I'm quite busy at the moment.

lionirdeadman avatar Dec 05 '20 02:12 lionirdeadman