Skip refreshing roles if the member is role-muted (#118)

Closes #116
This commit is contained in:
Macintxsh 2023-09-27 21:27:28 +03:00 committed by GitHub
parent f2db7f016c
commit 906bfd07e8
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,11 +110,14 @@ public sealed class GuildDataService : IHostedService
continue; continue;
} }
if (data.MutedUntil is null)
{
var memberResult = await _guildApi.GetGuildMemberAsync(guildId, data.Id.ToSnowflake(), ct); var memberResult = await _guildApi.GetGuildMemberAsync(guildId, data.Id.ToSnowflake(), ct);
if (memberResult.IsSuccess) if (memberResult.IsSuccess)
{ {
data.Roles = memberResult.Entity.Roles.ToList().ConvertAll(r => r.Value); data.Roles = memberResult.Entity.Roles.ToList().ConvertAll(r => r.Value);
} }
}
memberData.Add(data.Id, data); memberData.Add(data.Id, data);
} }