diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-19 18:58:47 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-19 18:58:47 -0400 |
commit | 83b480742b46f120b73042791e2f91c70ce3fe84 (patch) | |
tree | 31165ded8fc274cfa6de12b2dcc51066c98e389b /discord | |
parent | 72d0a0d2a098d9f75291bdad73d02d3601c82945 (diff) | |
download | abaddon-portaudio-83b480742b46f120b73042791e2f91c70ce3fe84.tar.gz abaddon-portaudio-83b480742b46f120b73042791e2f91c70ce3fe84.zip |
guild icons
Diffstat (limited to 'discord')
-rw-r--r-- | discord/guild.cpp | 4 | ||||
-rw-r--r-- | discord/guild.hpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/discord/guild.cpp b/discord/guild.cpp index fae30f1..35db47c 100644 --- a/discord/guild.cpp +++ b/discord/guild.cpp @@ -54,3 +54,7 @@ void from_json(const nlohmann::json &j, Guild &m) { JS_O("approximate_member_count", m.ApproximateMemberCount); JS_O("approximate_presence_count", m.ApproximatePresenceCount); } + +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 d90c3e8..4966b34 100644 --- a/discord/guild.hpp +++ b/discord/guild.hpp @@ -64,4 +64,6 @@ struct Guild { // * - documentation says only sent in GUILD_CREATE, but these can be sent anyways in the READY event friend void from_json(const nlohmann::json &j, Guild &m); + + std::string GetIconURL(std::string ext = "png", std::string size = "32") const; }; |