mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-29 18:49:53 +03:00
Do not clear BannedUntil if automatic unbanning wasn't successful
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
9c080d9691
commit
f4738e5dd4
2 changed files with 4 additions and 2 deletions
|
@ -33,9 +33,10 @@ public class GuildUpdateService : BackgroundService {
|
|||
|
||||
foreach (var memberData in data.MemberData.Values)
|
||||
if (DateTimeOffset.UtcNow > memberData.BannedUntil) {
|
||||
_ = _guildApi.RemoveGuildBanAsync(
|
||||
var unbanResult = await _guildApi.RemoveGuildBanAsync(
|
||||
guildId, memberData.Id.ToDiscordSnowflake(), Messages.PunishmentExpired.EncodeHeader(), ct);
|
||||
memberData.BannedUntil = null;
|
||||
if (unbanResult.IsSuccess)
|
||||
memberData.BannedUntil = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue