From 2cc3b48a5099f6880941330539fdb003fc45ea54 Mon Sep 17 00:00:00 2001 From: Erisa A Date: Sun, 19 May 2024 11:57:15 +0100 Subject: [PATCH] Apply suggestions from code review --- Tasks/PunishmentTasks.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/PunishmentTasks.cs b/Tasks/PunishmentTasks.cs index a52e51bf..62e98ce9 100644 --- a/Tasks/PunishmentTasks.cs +++ b/Tasks/PunishmentTasks.cs @@ -66,10 +66,12 @@ public static async Task CheckAutomaticWarningsAsync() { if (Program.cfgjson.AutoWarnMsgAutoDeleteDays == 0) return false; + Dictionary warnList = Program.db.HashGetAll("automaticWarnings").ToDictionary( x => x.Name.ToString(), x => JsonConvert.DeserializeObject(x.Value) ); + if (warnList is null | warnList.Keys.Count == 0) return false; else @@ -87,9 +89,7 @@ public static async Task 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; } }