summaryrefslogtreecommitdiff
path: root/src/discord/objects.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-08-31 01:51:02 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-08-31 01:51:02 -0400
commit0fa33915da6255cf7460758197eaea7e43353543 (patch)
tree15a92a3aae2cd2647c24ce4c44f1aaca01fcf422 /src/discord/objects.cpp
parent634f51fb4117c0870399e73560ac313d68d281e8 (diff)
downloadabaddon-portaudio-0fa33915da6255cf7460758197eaea7e43353543.tar.gz
abaddon-portaudio-0fa33915da6255cf7460758197eaea7e43353543.zip
rudimentary voice implementation
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);
+}