summaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-12-21 19:08:44 -0500
committerouwou <26526779+ouwou@users.noreply.github.com>2020-12-21 19:08:44 -0500
commitd8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe (patch)
tree667eb93e54d0698b62f098e911a24e70fb0448be /discord
parent486d184c8306d3e8a4889a5b079cd9b3003896c2 (diff)
downloadabaddon-portaudio-d8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe.tar.gz
abaddon-portaudio-d8ff05ddf898dfcd6fa0e3398cc38abcab07e2fe.zip
support animated guild icon
Diffstat (limited to 'discord')
-rw-r--r--discord/guild.cpp4
-rw-r--r--discord/guild.hpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/discord/guild.cpp b/discord/guild.cpp
index 13e20bf..c3c35b9 100644
--- a/discord/guild.cpp
+++ b/discord/guild.cpp
@@ -122,6 +122,10 @@ bool Guild::HasIcon() const {
return Icon != "";
}
+bool Guild::HasAnimatedIcon() const {
+ return HasIcon() && Icon[0] == 'a' && Icon[1] == '_';
+}
+
std::string Guild::GetIconURL(std::string ext, std::string size) const {
return "https://cdn.discordapp.com/icons/" + std::to_string(ID) + "/" + Icon + "." + ext + "?size=" + size;
}
diff --git a/discord/guild.hpp b/discord/guild.hpp
index d0863d5..ba46d75 100644
--- a/discord/guild.hpp
+++ b/discord/guild.hpp
@@ -68,6 +68,7 @@ struct Guild {
void update_from_json(const nlohmann::json &j);
bool HasIcon() const;
+ bool HasAnimatedIcon() const;
std::string GetIconURL(std::string ext = "png", std::string size = "32") const;
std::vector<Snowflake> GetSortedChannels(Snowflake ignore = Snowflake::Invalid) const;
};