From 40368cc379a91b34bc5b660055c9eb14f9a7319e Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Sat, 13 Feb 2021 23:24:42 +0100 Subject: [PATCH] Fix changing default state for a cog as enabled/disabled (#4768) * Fix changing default state for a cog as enabled/disabled * Add `, None` --- redbot/core/settings_caches.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/core/settings_caches.py b/redbot/core/settings_caches.py index e829689be..0045bba62 100644 --- a/redbot/core/settings_caches.py +++ b/redbot/core/settings_caches.py @@ -437,7 +437,7 @@ class DisabledCogCache: This should be the cog's qualified name, not necessarily the classname """ await self._config.custom("COG_DISABLE_SETTINGS", cog_name, 0).disabled.set(True) - del self._disable_map[cog_name] + self._disable_map.pop(cog_name, None) async def default_enable(self, cog_name: str): """ @@ -449,7 +449,7 @@ class DisabledCogCache: This should be the cog's qualified name, not necessarily the classname """ await self._config.custom("COG_DISABLE_SETTINGS", cog_name, 0).disabled.clear() - del self._disable_map[cog_name] + self._disable_map.pop(cog_name, None) async def disable_cog_in_guild(self, cog_name: str, guild_id: int) -> bool: """