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

Command raises an unhandled error if an ID too large is provided #6431

Open
Zephyrkul opened this issue Aug 14, 2024 · 0 comments
Open

Command raises an unhandled error if an ID too large is provided #6431

Zephyrkul opened this issue Aug 14, 2024 · 0 comments
Labels
Category: Cogs - Mod This is related to the Mod cog. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

Comments

@Zephyrkul
Copy link
Contributor

What Red version are you using?

3.4.5

Cog name

Mod

Command name

ban

What did you expect to happen?

The bot to respond that the provided user ID is too large / not a user ID

What actually happened?

Unhandled error, traceback below:

Exception in command 'ban'
Traceback (most recent call last):
  File "/home/.../.local/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.../.local/lib/python3.11/site-packages/redbot/cogs/mod/kickban.py", line 398, in ban
    success_, message = await self.ban_user(
                        ^^^^^^^^^^^^^^^^^^^^
  File "/home/.../.local/lib/python3.11/site-packages/redbot/cogs/mod/kickban.py", line 160, in ban_user
    await guild.fetch_ban(user)
  File "/home/.../.local/lib/python3.11/site-packages/discord/guild.py", line 2394, in fetch_ban
    data: BanPayload = await self._state.http.get_ban(user.id, self.id)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/.../.local/lib/python3.11/site-packages/discord/http.py", line 758, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In user_id: snowflake value should be less than or equal to 9223372036854775807.

How can we reproduce this error?

Use [p]ban with an ID larger than 2^63-1

Anything else?

Other commands that take in a user ID and make an API request might also have to be double-checked

@Zephyrkul Zephyrkul added the Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. label Aug 14, 2024
@github-actions github-actions bot added the Status: Needs Triage This has not been labeled or discussed for handling yet. label Aug 14, 2024
@Kowlin Kowlin added Status: Accepted We want this and removed Status: Needs Triage This has not been labeled or discussed for handling yet. labels Aug 24, 2024
@Flame442 Flame442 added the Category: Cogs - Mod This is related to the Mod cog. label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Cogs - Mod This is related to the Mod cog. Status: Accepted We want this Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

No branches or pull requests

3 participants