Skip to content

Commit

Permalink
god i need sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
loukylor committed Dec 29, 2024
1 parent e735213 commit 252bfce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TrickFireDiscordBot/Services/RoleSyncer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Task<PaginatedList<Page>> nextPageQuery(string? cursor) =>
DiscordRole inactiveRole = _discordRoleCache.Values.First(role => role.Id == options.Value.InactiveRoleId);
await foreach (DiscordMember member in discordService.MainGuild.GetAllMembersAsync())
{
if (processedMembers.Contains(member) || member.Roles.Any(role => options.Value.SafeRoleIds.Contains(role.Id)))
if (processedMembers.Contains(member) || member.Roles.Any(role => options.Value.SafeRoleIds.Contains(role.Id) || role.IsManaged))
{
continue;
}
Expand All @@ -84,7 +84,7 @@ Task<PaginatedList<Page>> nextPageQuery(string? cursor) =>
await member.ModifyAsync(model =>
{
List<DiscordRole> newRoles = new(member.Roles.Where(
role => options.Value.IgnoredRoleIds.Contains(role.Id) || role.IsManaged
role => options.Value.IgnoredRoleIds.Contains(role.Id)
))
{
inactiveRole
Expand Down Expand Up @@ -162,7 +162,7 @@ await member.ModifyAsync(model =>

List<DiscordRole> rolesWithLeadership = new(newRoles);
rolesWithLeadership.AddRange(member.Roles.Where(
role => role.Position >= highestRole || options.Value.IgnoredRoleIds.Contains(role.Id) || role.IsManaged
role => role.Position >= highestRole || options.Value.IgnoredRoleIds.Contains(role.Id)
));

model.Roles = rolesWithLeadership;
Expand Down

0 comments on commit 252bfce

Please sign in to comment.