Channels¶
channels
¶
GuildChannelCacheAddon
¶
Bases: Addon
flowchart TD
scurrypy.ext.cache.channels.GuildChannelCacheAddon[GuildChannelCacheAddon]
scurrypy.bases.addon.Addon[Addon]
scurrypy.bases.addon.Addon --> scurrypy.ext.cache.channels.GuildChannelCacheAddon
click scurrypy.ext.cache.channels.GuildChannelCacheAddon href "" "scurrypy.ext.cache.channels.GuildChannelCacheAddon"
click scurrypy.bases.addon.Addon href "" "scurrypy.bases.addon.Addon"
Defines caching channels and lookup.
bot = client
instance-attribute
¶
channels: dict[Snowflake, dict[Snowflake, JsonQuery]] = {}
instance-attribute
¶
channel_index: dict[Snowflake, JsonQuery] = {}
instance-attribute
¶
on_guild_create
async
¶
Append new guild channels to cache. Also add channels to index.
Parameters:
-
event(JsonQuery) –the GUILD_CREATE event
on_guild_delete
async
¶
Remove guild channels from cache. Also remove channels from index
Parameters:
-
event(JsonQuery) –the GUILD_DELETE event
on_channel_create
async
¶
Append channel to guild key. Also append channel to index.
Raises:
-
MissingField–no associated guild ID
Parameters:
-
event(JsonQuery) –the CHANNEL_CREATE event
on_channel_update
async
¶
Replace channel in guild key. Also replace channel in index.
Raises:
-
MissingField–no associated guild ID
Parameters:
-
event(JsonQuery) –the CHANNEL_UPDATE event
on_channel_delete
async
¶
Remove channel from guild key. Also remove channel from index.
Raises:
-
MissingField–no associated guild ID
Parameters:
-
event(JsonQuery) –the CHANNEL_DELETE event
get_channel
async
¶
put
¶
Put a new channel into the cache.
Parameters:
-
channel(JsonQuery) –the channel object
Raises:
-
MissingField–no associated guild ID