diff options
Diffstat (limited to 'discord')
-rw-r--r-- | discord/guild.cpp | 4 | ||||
-rw-r--r-- | discord/guild.hpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/discord/guild.cpp b/discord/guild.cpp index bf279e7..8062575 100644 --- a/discord/guild.cpp +++ b/discord/guild.cpp @@ -57,6 +57,10 @@ void from_json(const nlohmann::json &j, Guild &m) { JS_O("approximate_presence_count", m.ApproximatePresenceCount); } +bool Guild::HasIcon() const { + return Icon != ""; +} + 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 4966b34..a618335 100644 --- a/discord/guild.hpp +++ b/discord/guild.hpp @@ -65,5 +65,6 @@ struct Guild { friend void from_json(const nlohmann::json &j, Guild &m); + bool HasIcon() const; std::string GetIconURL(std::string ext = "png", std::string size = "32") const; }; |