kaogurai / cogs

Red cogs made for kaogurai
MIT License
13 stars 9 forks source link

[Search] IndexError: list index out of range #26

Closed cool-aid-man closed 6 months ago

cool-aid-man commented 11 months ago

Hey ryan Hope you're doing great with college and all :)

Getting this error on <p>imagesearch @mention mention can be discord role/user

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/astra/cogs/CogManager/cogs/search/search.py", line 153, in imagesearch
    await menu(ctx, embeds, DEFAULT_CONTROLS)
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/redbot/core/utils/menus.py", line 116, 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/ubuntu/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: IndexError: list index out of range

Thanks

Ryan5453 commented 6 months ago

Fixed in v2.0.1 (will be published soon)