From 9a6bed29928f736bdda5f5addb3dc165a4e8d996 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 17 Jun 2020 22:16:08 -0500 Subject: [PATCH] Fix message constructor --- src/message.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/message.nim b/src/message.nim index 47333c0..d2a167e 100644 --- a/src/message.nim +++ b/src/message.nim @@ -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() )