Update message.created_at to be aware of timezone
This commit is contained in:
parent
7c8d0a771d
commit
4321bc894b
@ -1,6 +1,6 @@
|
|||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from datetime import datetime
|
from datetime import datetime, timezone
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ class MessageEvents(commands.Cog):
|
|||||||
'author': message.author.id,
|
'author': message.author.id,
|
||||||
'guild': message.guild.id,
|
'guild': message.guild.id,
|
||||||
'channel': message.channel.id,
|
'channel': message.channel.id,
|
||||||
'created_at': message.created_at.timestamp(),
|
'created_at': message.created_at.replace(tzinfo=timezone.utc),
|
||||||
'tagged_everyone': message.mention_everyone,
|
'tagged_everyone': message.mention_everyone,
|
||||||
'content': message.content,
|
'content': message.content,
|
||||||
'embeds': [e.to_dict() for e in message.embeds],
|
'embeds': [e.to_dict() for e in message.embeds],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user