summaryrefslogtreecommitdiff
path: root/discord/channel.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-10-19 20:35:10 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-10-19 20:35:10 -0400
commitcb73bba135933357878dc47f6e7a6bec3168d001 (patch)
tree0bcced1046c53b6322a6d680db4aca7edbc9371f /discord/channel.cpp
parent49a6e581375fdf0b5f5e82f981ca2d7cb419267f (diff)
downloadabaddon-portaudio-cb73bba135933357878dc47f6e7a6bec3168d001.tar.gz
abaddon-portaudio-cb73bba135933357878dc47f6e7a6bec3168d001.zip
CHANNEL_CREATE, CHANNEL_UPDATE, CHANNEL_DELETE
Diffstat (limited to 'discord/channel.cpp')
-rw-r--r--discord/channel.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/discord/channel.cpp b/discord/channel.cpp
index d104337..b99971c 100644
--- a/discord/channel.cpp
+++ b/discord/channel.cpp
@@ -22,6 +22,26 @@ void from_json(const nlohmann::json &j, Channel &m) {
JS_ON("last_pin_timestamp", m.LastPinTimestamp);
}
+void Channel::update_from_json(const nlohmann::json &j) {
+ JS_RD("type", Type);
+ JS_RD("guild_id", GuildID);
+ JS_RV("position", Position, -1);
+ JS_RD("permission_overwrites", PermissionOverwrites);
+ JS_RD("name", Name);
+ JS_RD("topic", Topic);
+ JS_RD("nsfw", IsNSFW);
+ JS_RD("last_message_id", LastMessageID);
+ JS_RD("bitrate", Bitrate);
+ JS_RD("user_limit", UserLimit);
+ JS_RD("rate_limit_per_user", RateLimitPerUser);
+ JS_RD("recipients", Recipients);
+ JS_RD("icon", Icon);
+ JS_RD("owner_id", OwnerID);
+ JS_RD("application_id", ApplicationID);
+ JS_RD("parent_id", ParentID);
+ JS_RD("last_pin_timestamp", LastPinTimestamp);
+}
+
const PermissionOverwrite *Channel::GetOverwrite(Snowflake id) const {
return Abaddon::Get().GetDiscordClient().GetPermissionOverwrite(ID, id);
}