mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -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,5 @@
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
from collections import defaultdict, deque
|
||||
|
||||
import discord
|
||||
@@ -60,7 +60,7 @@ class Events(MixinMeta):
|
||||
await modlog.create_case(
|
||||
self.bot,
|
||||
guild,
|
||||
message.created_at,
|
||||
message.created_at.replace(tzinfo=timezone.utc),
|
||||
"ban",
|
||||
author,
|
||||
guild.me,
|
||||
@@ -84,7 +84,7 @@ class Events(MixinMeta):
|
||||
await modlog.create_case(
|
||||
self.bot,
|
||||
guild,
|
||||
message.created_at,
|
||||
message.created_at.replace(tzinfo=timezone.utc),
|
||||
"kick",
|
||||
author,
|
||||
guild.me,
|
||||
@@ -116,7 +116,7 @@ class Events(MixinMeta):
|
||||
await modlog.create_case(
|
||||
self.bot,
|
||||
guild,
|
||||
message.created_at,
|
||||
message.created_at.replace(tzinfo=timezone.utc),
|
||||
"warning",
|
||||
author,
|
||||
guild.me,
|
||||
|
||||
Reference in New Issue
Block a user