From c574271cee57732b93e70938af0d159395c835c2 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Mon, 5 Apr 2021 22:28:23 +0200 Subject: [PATCH] Fix no dispatch on shared API token removal (#4917) --- redbot/core/bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redbot/core/bot.py b/redbot/core/bot.py index e25fb284f..c45769d05 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -1285,6 +1285,7 @@ class RedBase( async with self._config.custom(SHARED_API_TOKENS, service_name).all() as group: for name in token_names: group.pop(name, None) + self.dispatch("red_api_tokens_update", service_name, MappingProxyType(group)) async def remove_shared_api_services(self, *service_names: str): """ @@ -1304,6 +1305,9 @@ class RedBase( async with self._config.custom(SHARED_API_TOKENS).all() as group: for service in service_names: group.pop(service, None) + # dispatch needs to happen *after* it actually updates + for service in service_names: + self.dispatch("red_api_tokens_update", service, MappingProxyType({})) async def get_context(self, message, *, cls=commands.Context): return await super().get_context(message, cls=cls)