Voxel-Fox-Ltd / Flower

A Discord bot for growing virtual flowers in a virtual garden.
GNU General Public License v2.0
16 stars 12 forks source link

Catch ValueError in trade #64

Closed 4Kaylum closed 1 year ago

4Kaylum commented 3 years ago

The bot hit a Command raised an exception: ValueError: list.remove(x): x not in list error while running the f.trade <@!758047478078767195> command.

Traceback (most recent call last):
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/kae/Flower/./cogs/plant_shop_commands.py", line 632, in tradeplant
    pending_response.remove(payload.user.id)
ValueError: list.remove(x): x not in list

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

Traceback (most recent call last):
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/kae/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/kae/.local/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: ValueError: list.remove(x): x not in list
4Kaylum commented 1 year ago

No longer an issue with rewrite.