mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Fix auto-unban and auto-unmute always triggering (#119)
Flipping `>` to `<=` changed null handling semantics within the operator, causing the unban/unmute code to always run Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
906bfd07e8
commit
e907930623
1 changed files with 2 additions and 2 deletions
|
@ -123,7 +123,7 @@ public sealed partial class MemberUpdateService : BackgroundService
|
||||||
private async Task<Result> TryAutoUnbanAsync(
|
private async Task<Result> TryAutoUnbanAsync(
|
||||||
Snowflake guildId, Snowflake id, MemberData data, CancellationToken ct)
|
Snowflake guildId, Snowflake id, MemberData data, CancellationToken ct)
|
||||||
{
|
{
|
||||||
if (DateTimeOffset.UtcNow <= data.BannedUntil)
|
if (data.BannedUntil is null || DateTimeOffset.UtcNow <= data.BannedUntil)
|
||||||
{
|
{
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public sealed partial class MemberUpdateService : BackgroundService
|
||||||
private async Task<Result> TryAutoUnmuteAsync(
|
private async Task<Result> TryAutoUnmuteAsync(
|
||||||
Snowflake guildId, Snowflake id, MemberData data, CancellationToken ct)
|
Snowflake guildId, Snowflake id, MemberData data, CancellationToken ct)
|
||||||
{
|
{
|
||||||
if (DateTimeOffset.UtcNow <= data.MutedUntil)
|
if (data.MutedUntil is null || DateTimeOffset.UtcNow <= data.MutedUntil)
|
||||||
{
|
{
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue