Repository: Cog-Creators/Red-DiscordBot

Issue:
`[p]slowmode` error in console.
#### Command Bug.

#### What were you trying to do?

i was testing slowmode with different numbers `[p]slowmode 10000000000`

#### What were you expecting to happen?

That it told the `max` can only be up to 6 hours.

#### What actually happened?

it error into console but doesn't say anything in the chat.

Traceback (most recent call last):
  File "/home/aina/redenv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "/home/aina/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 851, in invoke
    await self.prepare(ctx)
  File "/home/aina/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 493, in prepare
    await self._parse_arguments(ctx)
  File "/home/aina/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 706, in _parse_arguments
    kwargs[name] = await self.transform(ctx, param)
  File "/home/aina/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 552, in transform
    return await self.do_conversion(ctx, converter, argument, param)
  File "/home/aina/redenv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 519, in do_conversion
    return await super().do_conversion(ctx, converter, argument, param)
  File "/home/aina/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 505, in do_conversion
    return await self._actual_conversion(ctx, converter, argument, param)
  File "/home/aina/redenv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 464, in _actual_conversion
    raise ConversionError(converter, exc) from exc
discord.ext.commands.errors.ConversionError: (<redbot.core.commands.converter.TimedeltaConverter object at 0x7fb6d2f60c70>, OverflowError('Python int too large to convert to C int'))

#### How can we reproduce this issue?

`load mod`

try `[p]slowmode 100000000000`
[Mod] Hidden error in slowmode with large ints
# Command bugs

#### Command name

`[p]slowmode 10000000000000000000000`
Technically this is an issue with `commands.TimedeltaConverter`'s handling of large ints

#### What cog is this command from?

Mod

#### What happened?

Nothing in chat, this error in console
```py
[2020-06-26 02:30:54] [ERROR] red: ConversionError
Traceback (most recent call last):
  File "\redbot\core\commands\converter.py", line 287, in convert
    delta = parse_timedelta(
  File "\redbot\core\commands\converter.py", line 115, in parse_timedelta
    delta = timedelta(**params)
OverflowError: Python int too large to convert to C int
```


Discussion:

Resolving patch:
diff --git a/redbot/core/commands/converter.py b/redbot/core/commands/converter.py
--- a/redbot/core/commands/converter.py
+++ b/redbot/core/commands/converter.py
@@ -112,7 +112,12 @@ def parse_timedelta(
                     _("`{unit}` is not a valid unit of time for this command").format(unit=k)
                 )
         if params:
-            delta = timedelta(**params)
+            try:
+                delta = timedelta(**params)
+            except OverflowError:
+                raise BadArgument(
+                    _("The time set is way too high, consider setting something reasonable.")
+                )
             if maximum and maximum < delta:
                 raise BadArgument(
                     _(


Test patch: