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)