Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.76k stars 2.3k forks source link

Slowmode causes 400 bad request #3450

Closed kennnyshiwa closed 4 years ago

kennnyshiwa commented 4 years ago

Command bugs

Command name

slowmode

What cog is this command from?

mod

What were you expecting to happen?

user to get a warning that slowmode max is 6 hours

What actually happened?

instead it didn't warn and caused a bad request

Traceback` (most recent call last):
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 79, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/bb8/redenv/lib/python3.8/site-packages/redbot/cogs/mod/slowmode.py", line 33, in slowmode
    await ctx.channel.edit(slowmode_delay=seconds)
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/channel.py", line 228, in edit
    await self._edit(options, reason=reason)
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/abc.py", line 261, in _edit
    data = await self._state.http.edit_channel(self.id, reason=reason, **options)
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/http.py", line 222, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 BAD REQUEST (error code: 50035): Invalid Form Body
In rate_limit_per_user: int value should be less than or equal to 21600.

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

Traceback (most recent call last):
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/bb8/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 BAD REQUEST (error code: 50035): Invalid Form Body
In rate_limit_per_user: int value should be less than or equal to 21600.

How can we reproduce this issue?

use [p]slowmode 31536000 or some other value larger than 6 hours,

Kowlin commented 4 years ago

Fixed in #3453