mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 14:37:02 +01:00
Message type can be already in int fix
This commit is contained in:
parent
0ec0b52501
commit
d9b8af9a4c
@ -11,6 +11,11 @@ def get_formatted_message(message):
|
|||||||
edit_ts = None
|
edit_ts = None
|
||||||
else:
|
else:
|
||||||
edit_ts = format_datetime(edit_ts)
|
edit_ts = format_datetime(edit_ts)
|
||||||
|
msg_type = message.type
|
||||||
|
if isinstance(msg_type, int):
|
||||||
|
msg_type = int(msg_type)
|
||||||
|
else:
|
||||||
|
msg_type = message.type.value
|
||||||
msg = {
|
msg = {
|
||||||
"id": str(message.id),
|
"id": str(message.id),
|
||||||
"channel_id": str(message.channel.id),
|
"channel_id": str(message.channel.id),
|
||||||
@ -18,7 +23,7 @@ def get_formatted_message(message):
|
|||||||
"author": get_message_author(message),
|
"author": get_message_author(message),
|
||||||
"timestamp": format_datetime(message.created_at),
|
"timestamp": format_datetime(message.created_at),
|
||||||
"edited_timestamp": edit_ts,
|
"edited_timestamp": edit_ts,
|
||||||
"type": message.type.value,
|
"type": msg_type,
|
||||||
}
|
}
|
||||||
if hasattr(message, "mentions"):
|
if hasattr(message, "mentions"):
|
||||||
msg["mentions"] = get_message_mentions(message.mentions)
|
msg["mentions"] = get_message_mentions(message.mentions)
|
||||||
|
Loading…
Reference in New Issue
Block a user