1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

Fix auto-unban log spam (#271)

Closes #255

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-03-18 21:26:04 +03:00 committed by GitHub
parent 398abad277
commit 1894b063ae
Signed by: GitHub
GPG key ID: B5690EEEBB952194

View file

@ -151,6 +151,13 @@ public sealed partial class MemberUpdateService : BackgroundService
return Result.FromSuccess();
}
var existingBanResult = await _guildApi.GetGuildBanAsync(guildId, id, ct);
if (!existingBanResult.IsDefined())
{
data.BannedUntil = null;
return Result.FromSuccess();
}
var unbanResult = await _guildApi.RemoveGuildBanAsync(
guildId, id, Messages.PunishmentExpired.EncodeHeader(), ct);
if (unbanResult.IsSuccess)