From 16ec0258c1cd6a7294525accec73d84dfc84f6f1 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Sun, 26 Jul 2020 09:11:30 +0100 Subject: [PATCH] Don't need to check if it's None cause we can handle None Exception Added another function to completely remove the modlogs value from dict --- settings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/settings.py b/settings.py index d8202170..6c76b87b 100644 --- a/settings.py +++ b/settings.py @@ -93,12 +93,14 @@ def del_modlog_channel(guildid): del modlogs[guildid] +def remove_modlog_channel(guildid): + modlogs[guildid] = None + + # Get the modlog channel of the guild that the user is in def get_modlog_for_guild(guildid): channel = modlogs[guildid] - if channel is not None: - return channel - return None + return channel # Before initialising the cache. Store the prefixes from the database within the cache