mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fix no dispatch on shared API token removal (#4917)
This commit is contained in:
parent
a6d15dc385
commit
c574271cee
@ -1285,6 +1285,7 @@ class RedBase(
|
|||||||
async with self._config.custom(SHARED_API_TOKENS, service_name).all() as group:
|
async with self._config.custom(SHARED_API_TOKENS, service_name).all() as group:
|
||||||
for name in token_names:
|
for name in token_names:
|
||||||
group.pop(name, None)
|
group.pop(name, None)
|
||||||
|
self.dispatch("red_api_tokens_update", service_name, MappingProxyType(group))
|
||||||
|
|
||||||
async def remove_shared_api_services(self, *service_names: str):
|
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:
|
async with self._config.custom(SHARED_API_TOKENS).all() as group:
|
||||||
for service in service_names:
|
for service in service_names:
|
||||||
group.pop(service, None)
|
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):
|
async def get_context(self, message, *, cls=commands.Context):
|
||||||
return await super().get_context(message, cls=cls)
|
return await super().get_context(message, cls=cls)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user