diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-28 02:00:15 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-02-28 02:00:15 -0500 |
commit | d6a8b8c33372fe41d9e7f8453d15f491b25680a6 (patch) | |
tree | 5510f4ae1065b55e950a013658eef336e5e876a8 /discord/guild.cpp | |
parent | 11358da24e0e73044aed389b1dbbf479808ca036 (diff) | |
download | abaddon-portaudio-d6a8b8c33372fe41d9e7f8453d15f491b25680a6.tar.gz abaddon-portaudio-d6a8b8c33372fe41d9e7f8453d15f491b25680a6.zip |
add members panel/change member roles
Diffstat (limited to 'discord/guild.cpp')
-rw-r--r-- | discord/guild.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/discord/guild.cpp b/discord/guild.cpp index bf99943..5fb524e 100644 --- a/discord/guild.cpp +++ b/discord/guild.cpp @@ -186,3 +186,14 @@ std::vector<Snowflake> GuildData::GetSortedChannels(Snowflake ignore) const { return ret; } + +std::vector<RoleData> GuildData::FetchRoles() const { + if (!Roles.has_value()) return {}; + std::vector<RoleData> ret; + for (const auto thing : *Roles) + ret.push_back(*Abaddon::Get().GetDiscordClient().GetRole(thing.ID)); + std::sort(ret.begin(), ret.end(), [](const RoleData &a, const RoleData &b) -> bool { + return a.Position > b.Position; + }); + return ret; +} |