Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa authored May 19, 2024
1 parent b42d460 commit 2cc3b48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tasks/PunishmentTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ public static async Task<bool> CheckAutomaticWarningsAsync()
{
if (Program.cfgjson.AutoWarnMsgAutoDeleteDays == 0)
return false;

Dictionary<string, UserWarning> warnList = Program.db.HashGetAll("automaticWarnings").ToDictionary(
x => x.Name.ToString(),
x => JsonConvert.DeserializeObject<UserWarning>(x.Value)
);

if (warnList is null | warnList.Keys.Count == 0)
return false;
else
Expand All @@ -87,9 +89,7 @@ public static async Task<bool> CheckAutomaticWarningsAsync()
success = true;
}
}
#if DEBUG
Program.discord.Logger.LogDebug(Program.CliptokEventID, "Checked automatic warnings at {time} with result: {result}", DateTime.Now, success);
#endif
return success;
}
}
Expand Down

0 comments on commit 2cc3b48

Please sign in to comment.