add members panel/change member roles

This commit is contained in:
ouwou
2021-02-28 02:00:15 -05:00
parent 11358da24e
commit d6a8b8c333
16 changed files with 619 additions and 2 deletions

View File

@@ -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;
}