elijabesu / SauriCogs

Random cogs for Red V3 that I needed and couldn't find so instead of paying someone, I learned how to do it on my own.
https://cogs.saurich.com
Mozilla Public License 2.0
20 stars 46 forks source link

[cookies] list index out of range #79

Open ltzmax opened 2 years ago

ltzmax commented 2 years ago

Heya ran command steal, and it errored, cookies is set to global.

Exception in command 'steal'
Traceback (most recent call last):
  File "/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/root/redbot/cogs/CogManager/cogs/cookies/cookies.py", line 137, in steal
    target_id = random.choice(ids)
  File "/usr/lib/python3.9/random.py", line 347, in choice
    return seq[self._randbelow(len(seq))]
IndexError: list index out of range

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

Traceback (most recent call last):
  File "/redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/redenv/lib/python3.9/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
elijabesu commented 2 years ago

Hey, was it just a one time error, or does it happen over and over again?

ltzmax commented 2 years ago

It happens everytime someone run steal.