Fix message constructor

This commit is contained in:
SeanOMik 2020-06-17 22:16:08 -05:00
parent 4cca6ca804
commit 9a6bed2992
No known key found for this signature in database
GPG Key ID: FA4D55AC05268A88
1 changed files with 3 additions and 3 deletions

View File

@ -66,8 +66,8 @@ type
proc newMessage*(messageJson: JsonNode): Message =
var msg = Message(
id: getIDFromJson(messageJson["id"].getStr()),
channelID: snowflake(messageJson["channel_id"].getBiggestInt()),
guildID: snowflake(messageJson{"guild_id"}.getBiggestInt()),
channelID: getIDFromJson(messageJson["channel_id"].getStr()),
guildID: getIDFromJson(messageJson{"guild_id"}.getStr()),
content: messageJson["content"].getStr(),
timestamp: messageJson["timestamp"].getStr(),
editedTimestamp: messageJson{"edited_timestamp"}.getStr(),
@ -79,7 +79,7 @@ proc newMessage*(messageJson: JsonNode): Message =
#embeds
#reactions?
pinned: messageJson["pinned"].getBool(),
webhookID: snowflake(messageJson{"webhook_id"}.getBiggestInt()),
webhookID: getIDFromJson(messageJson{"webhook_id"}.getStr()),
`type`: MessageType(messageJson["type"].getInt()),
flags: messageJson{"flags"}.getInt()
)