From 3b99b5bd23fa81136451889523f17108ec7ab365 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 22 Jun 2020 16:57:16 -0500 Subject: [PATCH] Fix some emoji json parsing issues --- src/nimcord/emoji.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nimcord/emoji.nim b/src/nimcord/emoji.nim index 8776c7d..99362e8 100644 --- a/src/nimcord/emoji.nim +++ b/src/nimcord/emoji.nim @@ -15,11 +15,12 @@ proc newEmoji*(json: JsonNode, guild: snowflake): Emoji = ## Construct an emoji with json. ## This shouldn't really be used by the user, only internal use. result = Emoji( - id: getIDFromJson(json["id"].getStr()), name: json["name"].getStr(), guildID: guild ) + if (json.contains("id")): + result.id = getIDFromJson(json["id"].getStr()) if (json.contains("roles")): for role in json["roles"]: result.roles.add(getIDFromJson(role.getStr()))