summaryrefslogtreecommitdiff
path: root/src/discord/objects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/discord/objects.cpp')
-rw-r--r--src/discord/objects.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/discord/objects.cpp b/src/discord/objects.cpp
index e43e05a..e4c61c5 100644
--- a/src/discord/objects.cpp
+++ b/src/discord/objects.cpp
@@ -640,3 +640,24 @@ void from_json(const nlohmann::json &j, GuildMembersChunkData &m) {
JS_D("members", m.Members);
JS_D("guild_id", m.GuildID);
}
+
+void to_json(nlohmann::json &j, const VoiceStateUpdateMessage &m) {
+ j["op"] = GatewayOp::VoiceStateUpdate;
+ j["d"]["guild_id"] = m.GuildID;
+ j["d"]["channel_id"] = m.ChannelID;
+ j["d"]["self_mute"] = m.SelfMute;
+ j["d"]["self_deaf"] = m.SelfDeaf;
+ j["d"]["self_video"] = m.SelfVideo;
+ j["d"]["preferred_region"] = m.PreferredRegion;
+}
+
+void from_json(const nlohmann::json &j, VoiceStateUpdateData &m) {
+ JS_ON("user_id", m.UserID);
+ JS_ON("session_id", m.SessionID);
+}
+
+void from_json(const nlohmann::json &j, VoiceServerUpdateData &m) {
+ JS_D("token", m.Token);
+ JS_D("guild_id", m.GuildID);
+ JS_D("endpoint", m.Endpoint);
+}