From d9b8af9a4ccb5fa3e8f741189be6c388ab3bc807 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Thu, 17 Oct 2019 00:50:34 -0700 Subject: [PATCH] Message type can be already in int fix --- discordbot/titanembeds/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/discordbot/titanembeds/utils.py b/discordbot/titanembeds/utils.py index d104838..271d5ab 100644 --- a/discordbot/titanembeds/utils.py +++ b/discordbot/titanembeds/utils.py @@ -11,6 +11,11 @@ def get_formatted_message(message): edit_ts = None else: 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 = { "id": str(message.id), "channel_id": str(message.channel.id), @@ -18,7 +23,7 @@ def get_formatted_message(message): "author": get_message_author(message), "timestamp": format_datetime(message.created_at), "edited_timestamp": edit_ts, - "type": message.type.value, + "type": msg_type, } if hasattr(message, "mentions"): msg["mentions"] = get_message_mentions(message.mentions)