summaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2021-07-20 17:55:03 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2021-07-20 17:55:03 -0400
commita4d0cd9612dfa8b60fed63f1088b59b1762d217a (patch)
treed385506037a43855c4d62bfe8129a4d86f0a1872 /discord
parentd20a822fdbd52c316e3b33a8dbf8c72e564a7986 (diff)
downloadabaddon-portaudio-a4d0cd9612dfa8b60fed63f1088b59b1762d217a.tar.gz
abaddon-portaudio-a4d0cd9612dfa8b60fed63f1088b59b1762d217a.zip
color nsfw channels
Diffstat (limited to 'discord')
-rw-r--r--discord/channel.cpp4
-rw-r--r--discord/channel.hpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/discord/channel.cpp b/discord/channel.cpp
index 68e73e9..9d90eb5 100644
--- a/discord/channel.cpp
+++ b/discord/channel.cpp
@@ -43,6 +43,10 @@ void ChannelData::update_from_json(const nlohmann::json &j) {
JS_RD("last_pin_timestamp", LastPinTimestamp);
}
+bool ChannelData::NSFW() const {
+ return IsNSFW.has_value() && *IsNSFW;
+}
+
std::optional<PermissionOverwrite> ChannelData::GetOverwrite(Snowflake id) const {
return Abaddon::Get().GetDiscordClient().GetPermissionOverwrite(ID, id);
}
diff --git a/discord/channel.hpp b/discord/channel.hpp
index b9bfd6d..68597e6 100644
--- a/discord/channel.hpp
+++ b/discord/channel.hpp
@@ -61,6 +61,7 @@ struct ChannelData {
friend void from_json(const nlohmann::json &j, ChannelData &m);
void update_from_json(const nlohmann::json &j);
+ bool NSFW() const;
std::optional<PermissionOverwrite> GetOverwrite(Snowflake id) const;
std::vector<UserData> GetDMRecipients() const;
};