forked from TeamInklings/Octobot
Fix auto-unban log spam (#271)
Closes #255 Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
398abad277
commit
1894b063ae
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Reference in a new issue