nano-shino / genshinhelper

A Discord bot to help with daily Genshin activities
MIT License
34 stars 11 forks source link

"max_values must be between 1 and 25" when running settings. #8

Closed ignaciocastro closed 2 years ago

ignaciocastro commented 2 years ago

When running /user settings to set up the daily rewards, I get this error. Every other command works as intended.

Jul 28 02:01:27 discord python3.9[3736]: ERROR:root:Application command error
Jul 28 02:01:27 discord python3.9[3736]: Traceback (most recent call last):
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 126, in wrapped
Jul 28 02:01:27 discord python3.9[3736]:     ret = await coro(arg)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 850, in _invoke
Jul 28 02:01:27 discord python3.9[3736]:     await self.callback(self.cog, ctx, **kwargs)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/genshinhelper/src/handlers/user_manager.py", line 235, in settings
Jul 28 02:01:27 discord python3.9[3736]:     view=PreferencesView(ctx, account.mihoyo_id, _guild_level, accounts),
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/genshinhelper/src/handlers/user_manager.py", line 411, in __init__
Jul 28 02:01:27 discord python3.9[3736]:     self.add_item(PreferencesDropdown(mihoyo_id, guild_level))
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/genshinhelper/src/handlers/user_manager.py", line 340, in __init__
Jul 28 02:01:27 discord python3.9[3736]:     self.max_values = len(self.options)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/ui/select.py", line 178, in max_values
Jul 28 02:01:27 discord python3.9[3736]:     raise ValueError("max_values must be between 1 and 25")
Jul 28 02:01:27 discord python3.9[3736]: ValueError: max_values must be between 1 and 25
Jul 28 02:01:27 discord python3.9[3736]: The above exception was the direct cause of the following exception:
Jul 28 02:01:27 discord python3.9[3736]: Traceback (most recent call last):
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/bot.py", line 993, in invoke_application_command
Jul 28 02:01:27 discord python3.9[3736]:     await ctx.command.invoke(ctx)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 357, in invoke
Jul 28 02:01:27 discord python3.9[3736]:     await injected(ctx)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 126, in wrapped
Jul 28 02:01:27 discord python3.9[3736]:     ret = await coro(arg)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 1124, in _invoke
Jul 28 02:01:27 discord python3.9[3736]:     await command.invoke(ctx)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 357, in invoke
Jul 28 02:01:27 discord python3.9[3736]:     await injected(ctx)
Jul 28 02:01:27 discord python3.9[3736]:   File "/home/ignacio/.local/lib/python3.9/site-packages/discord/commands/core.py", line 134, in wrapped
Jul 28 02:01:27 discord python3.9[3736]:     raise ApplicationCommandInvokeError(exc) from exc
Jul 28 02:01:27 discord python3.9[3736]: discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: ValueError: max_values must be between 1 and 25

image

nano-shino commented 2 years ago

You must set your guild to level 2 or higher in the .env file

nano-shino commented 2 years ago

Generally it's better advised that /user settings be done in DMs with the bot instead.