From ae97c1c1fee147cc4de897d2d04d06b1862fc921 Mon Sep 17 00:00:00 2001 From: Soashivito <118043209+Soashivito@users.noreply.github.com> Date: Wed, 9 Sep 2026 10:56:03 -0600 Subject: [PATCH 1/2] Change application_id to optional in channel.cpp discord sends "application_id": null on voice channels, but JS_O only checks contains(). Snowflake::from_json then falls through to get_to(uint64_t) on a null and throws type_error.302. --- src/discord/channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discord/channel.cpp b/src/discord/channel.cpp index 8b3ee19a..06c323f7 100644 --- a/src/discord/channel.cpp +++ b/src/discord/channel.cpp @@ -35,7 +35,7 @@ void from_json(const nlohmann::json &j, ChannelData &m) { JS_O("recipient_ids", m.RecipientIDs); JS_ON("icon", m.Icon); JS_O("owner_id", m.OwnerID); - JS_O("application_id", m.ApplicationID); + JS_ON("application_id", m.ApplicationID); JS_ON("parent_id", m.ParentID); JS_ON("last_pin_timestamp", m.LastPinTimestamp); JS_O("thread_metadata", m.ThreadMetadata); From c312d63a13d0c70ca582e614100b2d145dfbef90 Mon Sep 17 00:00:00 2001 From: Soashivito <118043209+Soashivito@users.noreply.github.com> Date: Wed, 9 Sep 2026 10:57:15 -0600 Subject: [PATCH 2/2] Change JS_O to JS_ON for application_id same JS_O issue as the channel's one, same optional target. --- src/discord/activity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/discord/activity.cpp b/src/discord/activity.cpp index 95dda5d9..bc95714d 100644 --- a/src/discord/activity.cpp +++ b/src/discord/activity.cpp @@ -66,7 +66,7 @@ void from_json(const nlohmann::json &j, ActivityData &m) { JS_ON("url", m.URL); JS_D("created_at", m.CreatedAt); JS_O("timestamps", m.Timestamps); - JS_O("application_id", m.ApplicationID); + JS_ON("application_id", m.ApplicationID); JS_ON("details", m.Details); JS_ON("state", m.State); JS_ON("emoji", m.Emoji);