You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding the 26th option did not raise a ValueError on Select
Reproduction Steps
Following PR #9875, I was writing test code for discord.ui.Select. At that time, I recognize that adding the 26th option didn't raise a ValueError. In fact, discord.ui.Select raises a ValueError when adding the 27th option.
A valueError is expected to occur when the 26th option is added to the select, not when sending the view to discord.
ValueError: maximumnumberofoptionsalreadyprovided
Actual Results
When I send Select with 26 options, discord.errors.HTTPException occured.
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In components.0.components.0.options: Must be between 1 and 25 in length.
@MCausc78
I understand your point, but since adding the 27th option raises a ValueError, it seems more like an unintended behavior rather than a question of responsibility. Additionally, regardless of whose responsibility it is, discord.py does appear to be performing this validation (with some bug).
Summary
Adding the 26th option did not raise a ValueError on Select
Reproduction Steps
Following PR #9875, I was writing test code for
discord.ui.Select
. At that time, I recognize that adding the 26th option didn't raise a ValueError. In fact,discord.ui.Select
raises a ValueError when adding the 27th option.Minimal Reproducible Code
Expected Results
A valueError is expected to occur when the 26th option is added to the select, not when sending the view to discord.
Actual Results
When I send Select with 26 options,
discord.errors.HTTPException
occured.discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In components.0.components.0.options: Must be between 1 and 25 in length.
Intents
discord.Intents.all
System Information
$ python -m discord -v
Checklist
Additional Context
discord.py/discord/ui/select.py
Lines 502 to 503 in 3a80636
The text was updated successfully, but these errors were encountered: