mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
rewrite store
this probably should have been broken up into smaller commits. oh well
This commit is contained in:
@@ -191,8 +191,11 @@ std::vector<Snowflake> GuildData::GetSortedChannels(Snowflake ignore) const {
|
||||
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));
|
||||
for (const auto thing : *Roles) {
|
||||
auto r = Abaddon::Get().GetDiscordClient().GetRole(thing.ID);
|
||||
if (r.has_value())
|
||||
ret.push_back(*r);
|
||||
}
|
||||
std::sort(ret.begin(), ret.end(), [](const RoleData &a, const RoleData &b) -> bool {
|
||||
return a.Position > b.Position;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user