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

Fix auto-unban log spam

Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
Macintxsh 2024-03-18 16:42:36 +03:00
parent 5105b43eff
commit 025e6ec05e
Signed by: mctaylors
GPG key ID: 7181BEBE676903C1

View file

@ -151,6 +151,13 @@ public sealed partial class MemberUpdateService : BackgroundService
return Result.FromSuccess(); 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( var unbanResult = await _guildApi.RemoveGuildBanAsync(
guildId, id, Messages.PunishmentExpired.EncodeHeader(), ct); guildId, id, Messages.PunishmentExpired.EncodeHeader(), ct);
if (unbanResult.IsSuccess) if (unbanResult.IsSuccess)