1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-20 00:43:36 +03:00

Skip refreshing roles if the member is role-muted

This commit is contained in:
Macintxsh 2023-09-27 21:22:19 +03:00
parent 1ab5a640a9
commit 73b6031529
Signed by: mctaylors
GPG key ID: 361D326747B61E65

View file

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