Skip to content

Commit

Permalink
Fix auto-unban log spam (#271)
Browse files Browse the repository at this point in the history
Closes #255

Signed-off-by: mctaylors <[email protected]>
  • Loading branch information
mctaylors authored Mar 18, 2024
1 parent 398abad commit 1894b06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Services/Update/MemberUpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ private async Task<Result> TryAutoUnbanAsync(
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)
Expand Down

0 comments on commit 1894b06

Please sign in to comment.