Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shop] More than 5 shops breaks the !shop buy command menu #259

Open
njhargis opened this issue Jun 1, 2022 · 1 comment
Open

[Shop] More than 5 shops breaks the !shop buy command menu #259

njhargis opened this issue Jun 1, 2022 · 1 comment

Comments

@njhargis
Copy link

njhargis commented Jun 1, 2022

I have added 5 shops and !shop buy works great, upon adding the sixth shop my buy command begins to break.
Log below.

Exception in command 'shop buy'
Traceback (most recent call last):
File "/home/neil/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "/home/neil/.local/share/Red-DiscordBot/data/Steamboat_Bill/cogs/CogManager/cogs/shop/shop.py", line 185, in buy
shop, item = await menu.display()
File "/home/neil/.local/share/Red-DiscordBot/data/Steamboat_Bill/cogs/CogManager/cogs/shop/menu.py", line 19, in display
msg, groups, page, maximum = await self.setup(data)
File "/home/neil/.local/share/Red-DiscordBot/data/Steamboat_Bill/cogs/CogManager/cogs/shop/menu.py", line 42, in setup
groups = self.group_data(data)
File "/home/neil/.local/share/Red-DiscordBot/data/Steamboat_Bill/cogs/CogManager/cogs/shop/menu.py", line 162, in group_data
grouped.append(self.sorter(data[idx : idx + 5]))
File "/home/neil/.local/share/Red-DiscordBot/data/Steamboat_Bill/cogs/CogManager/cogs/shop/menu.py", line 154, in sorter
return sorted(groups, key=lambda x: x[1]["Cost"], reverse=True)
File "/home/neil/.local/share/Red-DiscordBot/data/Steamboat_Bill/cogs/CogManager/cogs/shop/menu.py", line 154, in
return sorted(groups, key=lambda x: x[1]["Cost"], reverse=True)
TypeError: string indices must be integers

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

Traceback (most recent call last):
File "/home/neil/redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/home/neil/redenv/lib/python3.9/site-packages/redbot/core/commands/commands.py", line 832, in invoke
await super().invoke(ctx)
File "/home/neil/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1348, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/neil/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
[9:29 AM]
BOT
Steamboat Bill:
await injected(*ctx.args, **ctx.kwargs)
File "/home/neil/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: TypeError: string indices must be integers

@njhargis
Copy link
Author

njhargis commented Jun 1, 2022

Looks like this has been an issue since 2019.
https://discord.com/channels/240154543684321280/240302038565519361/623588710449152022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant