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

Timerole / Runtimerole error #217

Open
JJW8071 opened this issue Jun 19, 2023 · 1 comment
Open

Timerole / Runtimerole error #217

JJW8071 opened this issue Jun 19, 2023 · 1 comment

Comments

@JJW8071
Copy link

JJW8071 commented Jun 19, 2023

if check_time >= utcnow:

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
Copy link
Author

JJW8071 commented Jun 20, 2023

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant