Cog-Creators / Red-DiscordBot

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

Prevent OverflowError from very large timedeltas in Mutes #6353

Closed TrustyJAID closed 2 months ago

TrustyJAID commented 2 months ago

Description of the changes

Prevent Mute's converter from allowing timedeltas that would result in a datetime leading to an OverFlow error.

Have the changes in this PR been tested?

Yes

TrustyJAID commented 2 months ago

To add some context you can achieve this with [p]mute user 3650000d. The timedelta would not Overflow but this timedelta is then added to the current date in Mutes and that would end up Overflowing. I could try/catch all of those but I don't think we'll ever need a timedelta larger than a datetime can support.