bobloy / Fox-V3

Cogs for Red-DiscordBot V3 by Bobloy
https://discord.gg/GET4DVk
GNU Affero General Public License v3.0
54 stars 90 forks source link

Timerole / Runtimerole error #217

Open JJW8071 opened 1 year ago

JJW8071 commented 1 year ago

https://github.com/bobloy/Fox-V3/blob/43a39cccb70bacdfd28bb0feaa27c838fbd892e0/timerole/timerole.py#L287

Exception in command 'runtimerole' Traceback (most recent call last): File "C:\Users\jason\challengerenv\lib\site-packages\discord\ext\commands\core.py", line 229, in wrapped ret = await coro(*args, **kwargs) File "C:\Users\jason\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\Challenger\cogs\CogManager\cogs\timerole\timerole.py", line 74, in runtimerole await self.timerole_update() File "C:\Users\jason\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\Challenger\cogs\CogManager\cogs\timerole\timerole.py", line 287, in timerole_update if check_time >= utcnow: TypeError: can't compare offset-naive and offset-aware datetimes

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

Traceback (most recent call last): File "C:\Users\jason\challengerenv\lib\site-packages\discord\ext\commands\bot.py", line 1350, in invoke await ctx.command.invoke(ctx) File "C:\Users\jason\challengerenv\lib\site-packages\discord\ext\commands\core.py", line 1023, in invoke await injected(*ctx.args, **ctx.kwargs) # type: ignore File "C:\Users\jason\challengerenv\lib\site-packages\discord\ext\commands\core.py", line 238, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: can't compare offset-naive and offset-aware datetimes

287 if check_time.timestamp() >= utcnow.timestamp():

JJW8071 commented 1 year ago

Same issue on line 257 and datetime.fromisoformat(mr_dict["check_again_time"]) >= utcnow to and datetime.fromisoformat(mr_dict["check_again_time"]).timestamp() >= utcnow.timestamp()