mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Use aware objects when storing and reading UTC timestamps (#4017)
* Use aware objects instead of naive ones * Use aware objects when storing and reading UTC timestamps * Remove unneeded parentheses * Fixed naive and aware objects unable to be compared here * Address feedback * Fix the newly added `modlog.create_case()` calls Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import asyncio
|
||||
import contextlib
|
||||
from datetime import timezone
|
||||
from collections import namedtuple
|
||||
from copy import copy
|
||||
from typing import Union, Optional, Literal
|
||||
@@ -494,7 +495,7 @@ class Warnings(commands.Cog):
|
||||
await modlog.create_case(
|
||||
self.bot,
|
||||
ctx.guild,
|
||||
ctx.message.created_at,
|
||||
ctx.message.created_at.replace(tzinfo=timezone.utc),
|
||||
"warning",
|
||||
user,
|
||||
ctx.message.author,
|
||||
@@ -616,7 +617,7 @@ class Warnings(commands.Cog):
|
||||
await modlog.create_case(
|
||||
self.bot,
|
||||
ctx.guild,
|
||||
ctx.message.created_at,
|
||||
ctx.message.created_at.replace(tzinfo=timezone.utc),
|
||||
"unwarned",
|
||||
member,
|
||||
ctx.message.author,
|
||||
|
||||
Reference in New Issue
Block a user