mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[Core] Dispatch on_red_api_tokens_update event on api keys update (#3146)
* feat: dispatch `on_red_api_tokens_update` event on api keys update * docs: add event reference in Shared API Keys docs * chore(changelog): add tonwcrier entries * fix: wrap dispatched api tokens in MappingProxyType * docs: reflect change of type change to read-only Mapping
This commit is contained in:
@@ -46,3 +46,17 @@ Basic Usage
|
||||
if youtube_keys.get("api_key") is None:
|
||||
return await ctx.send("The YouTube API key has not been set.")
|
||||
# Use the API key to access content as you normally would
|
||||
|
||||
|
||||
***************
|
||||
Event Reference
|
||||
***************
|
||||
|
||||
.. function:: on_red_api_tokens_update(service_name, api_tokens)
|
||||
|
||||
Dispatched when service's api keys are updated.
|
||||
|
||||
:param service_name: Name of the service.
|
||||
:type service_name: :class:`str`
|
||||
:param api_tokens: New Mapping of token names to tokens. This contains api tokens that weren't changed too.
|
||||
:type api_tokens: Mapping[:class:`str`, :class:`str`]
|
||||
|
||||
Reference in New Issue
Block a user