Skip to content

sake.abc#

Protocols and abstract classes for the cache resources defined by this standard.

Note

Unlike the abstract classes defined here, there is no guarantee that the protocols defined here will be included in the MRO of the classes which implement them.

Cache #

Bases: GuildCache, EmojiCache, GuildChannelCache, InviteCache, MeCache, MemberCache, MessageCache, PresenceCache, RoleCache, UserCache, VoiceStateCache, ABC

Protocol of a cache which implements all the defined resources.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_emojis abstractmethod async #

clear_emojis()

Empty the emoji cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_guild_channels abstractmethod async #

clear_guild_channels()

Empty the guild channel cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_guilds abstractmethod async #

clear_guilds()

Empty the guild cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_invites abstractmethod async #

clear_invites()

Empty the invites cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_members abstractmethod async #

clear_members()

Empty the members cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages abstractmethod async #

clear_messages()

Empty the messages cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_presences abstractmethod async #

clear_presences()

Empty the presences cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_roles abstractmethod async #

clear_roles()

Empty the roles cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_users abstractmethod async #

clear_users()

Empty the users cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_voice_states abstractmethod async #

clear_voice_states()

Empty the voice states cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_emoji abstractmethod async #

delete_emoji(emoji_id)

Remove an emoji from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_guild abstractmethod async #

delete_guild(guild_id)

Remove a guild from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_guild_channel abstractmethod async #

delete_guild_channel(channel_id)

Remove a guild guild channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_invite abstractmethod async #

delete_invite(invite_code)

Remove an invite channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • invite_code (str) –

    The code of the invite to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_me abstractmethod async #

delete_me()

Remove the cached own user entry.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_member abstractmethod async #

delete_member(guild_id, user_id)

Remove a member from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached member for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_message abstractmethod async #

delete_message(message_id)

Remove a message from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_presence abstractmethod async #

delete_presence(guild_id, user_id)

Remove a presence from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached presence for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_role abstractmethod async #

delete_role(role_id)

Remove a role from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_user abstractmethod async #

delete_user(user_id)

Remove a user from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_voice_state abstractmethod async #

delete_voice_state(guild_id, user_id)

Remove a voice state from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached voice state for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_emoji abstractmethod async #

get_emoji(emoji_id)

Get an emoji from the cache.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_guild abstractmethod async #

get_guild(guild_id)

Get a guild from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get from the cache.

Returns:

  • GatewayGuild

    The object of the guild fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_guild_channel abstractmethod async #

get_guild_channel(channel_id)

Get a guild channel from the cache.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_invite abstractmethod async #

get_invite(invite_code)

Get an invite from the cache.

Parameters:

  • invite_code (str) –

    The code of the invite to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_me abstractmethod async #

get_me()

Get the own user cache entry.

Returns:

  • OwnUser

    The object of the own user fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_member abstractmethod async #

get_member(guild_id, user_id)

Get a member from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached member for.

Returns:

  • Member

    The object of the member fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_message abstractmethod async #

get_message(message_id)

Get a message from the cache.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to get from the cache.

Returns:

  • Message

    The object of the message fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_presence abstractmethod async #

get_presence(guild_id, user_id)

Get a presence from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached presence for.

Returns:

  • MemberPresence

    The object of the presence fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_role abstractmethod async #

get_role(role_id)

Get a role from the cache.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to get from the cache.

Returns:

  • Role

    The object of the role fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_user abstractmethod async #

get_user(user_id)

Get a user from the cache.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to get from the cache.

Returns:

  • User

    The object of the user fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_voice_state abstractmethod async #

get_voice_state(guild_id, user_id)

Get a voice state from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached voice state for.

Returns:

  • VoiceState

    The object of the voice state fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_emojis abstractmethod #

iter_emojis()

Iterate over the emojis stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guild_channels abstractmethod #

iter_guild_channels()

Iterate over the guild channels stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guilds abstractmethod #

iter_guilds()

Iterate over the guilds stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites abstractmethod #

iter_invites()

Iterate over the invites stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members abstractmethod #

iter_members()

Iterate over the members stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages abstractmethod #

iter_messages()

Iterate over the messages stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences abstractmethod #

iter_presences()

Iterate over the presences stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_roles abstractmethod #

iter_roles()

Iterate over the roles stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_users abstractmethod #

iter_users()

Iterate over the users stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states abstractmethod #

iter_voice_states()

Iterate over the voice states stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

CacheIterator #

Bases: LazyIterator[_T], ABC

A asynchronous iterator of entries within a defined cache store.

len abstractmethod async #

len()

Get the count of entries that this iterator covers.

Note

Unlike hikari.iterators.LazyIterator.count, this will not exhaust the iterator and may return different values as entries are added and removed from the cache.

Returns:

  • int

    The count of entries that this iterator covers as of the call.

EmojiCache #

Bases: Resource, ABC

The traits of a implementation which supports a emoji cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_emojis abstractmethod async #

clear_emojis()

Empty the emoji cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_emoji abstractmethod async #

delete_emoji(emoji_id)

Remove an emoji from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_emoji abstractmethod async #

get_emoji(emoji_id)

Get an emoji from the cache.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_emojis abstractmethod #

iter_emojis()

Iterate over the emojis stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

GuildCache #

Bases: Resource, ABC

The traits of a implementation which supports a guild cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_guilds abstractmethod async #

clear_guilds()

Empty the guild cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_guild abstractmethod async #

delete_guild(guild_id)

Remove a guild from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_guild abstractmethod async #

get_guild(guild_id)

Get a guild from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get from the cache.

Returns:

  • GatewayGuild

    The object of the guild fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guilds abstractmethod #

iter_guilds()

Iterate over the guilds stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

GuildChannelCache #

Bases: Resource, ABC

The traits of a implementation which supports a guild channel cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_guild_channels abstractmethod async #

clear_guild_channels()

Empty the guild channel cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_guild_channel abstractmethod async #

delete_guild_channel(channel_id)

Remove a guild guild channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_guild_channel abstractmethod async #

get_guild_channel(channel_id)

Get a guild channel from the cache.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guild_channels abstractmethod #

iter_guild_channels()

Iterate over the guild channels stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

InviteCache #

Bases: Resource, ABC

The traits of a implementation which supports a invite cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_invites abstractmethod async #

clear_invites()

Empty the invites cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_invite abstractmethod async #

delete_invite(invite_code)

Remove an invite channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • invite_code (str) –

    The code of the invite to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_invite abstractmethod async #

get_invite(invite_code)

Get an invite from the cache.

Parameters:

  • invite_code (str) –

    The code of the invite to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites abstractmethod #

iter_invites()

Iterate over the invites stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

MeCache #

Bases: Resource, ABC

The traits of a implementation which supports a own user cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_me abstractmethod async #

delete_me()

Remove the cached own user entry.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_me abstractmethod async #

get_me()

Get the own user cache entry.

Returns:

  • OwnUser

    The object of the own user fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

MemberCache #

Bases: Resource, ABC

The traits of a implementation which supports a member cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_members abstractmethod async #

clear_members()

Empty the members cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_member abstractmethod async #

delete_member(guild_id, user_id)

Remove a member from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached member for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_member abstractmethod async #

get_member(guild_id, user_id)

Get a member from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached member for.

Returns:

  • Member

    The object of the member fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members abstractmethod #

iter_members()

Iterate over the members stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

MessageCache #

Bases: Resource, ABC

The traits of a implementation which supports a message cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_messages abstractmethod async #

clear_messages()

Empty the messages cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_message abstractmethod async #

delete_message(message_id)

Remove a message from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_message abstractmethod async #

get_message(message_id)

Get a message from the cache.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to get from the cache.

Returns:

  • Message

    The object of the message fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages abstractmethod #

iter_messages()

Iterate over the messages stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

PresenceCache #

Bases: Resource, ABC

The traits of a implementation which supports a presence cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_presences abstractmethod async #

clear_presences()

Empty the presences cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_presence abstractmethod async #

delete_presence(guild_id, user_id)

Remove a presence from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached presence for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_presence abstractmethod async #

get_presence(guild_id, user_id)

Get a presence from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached presence for.

Returns:

  • MemberPresence

    The object of the presence fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences abstractmethod #

iter_presences()

Iterate over the presences stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefCache #

Bases: Cache, RefGuildCache, RefEmojiCache, RefGuildChannelCache, RefInviteCache, RefMeCache, RefMemberCache, RefMessageCache, RefPresenceCache, RefRoleCache, RefUserCache, RefVoiceStateCache, ABC

Protocol of a cache which implements all the defined reference resources.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_emojis abstractmethod async #

clear_emojis()

Empty the emoji cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_emojis_for_guild abstractmethod async #

clear_emojis_for_guild(guild_id)

Remove emojis belonging to a specific guild from the cache.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the emojis cached for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_guild_channels abstractmethod async #

clear_guild_channels()

Empty the guild channel cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_guild_channels_for_guild abstractmethod async #

clear_guild_channels_for_guild(guild_id)

Remove the guild channel cache store for the specified guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached channels for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_guilds abstractmethod async #

clear_guilds()

Empty the guild cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_invites abstractmethod async #

clear_invites()

Empty the invites cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_invites_for_channel abstractmethod async #

clear_invites_for_channel(channel_id)

Remove invites cached for a specific channel..

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to remove the invites cached for it.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_invites_for_guild abstractmethod async #

clear_invites_for_guild(guild_id)

Remove invites cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the invites cached for it.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_members abstractmethod async #

clear_members()

Empty the members cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_members_for_guild abstractmethod async #

clear_members_for_guild(guild_id)

Remove the members cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached members for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_members_for_user abstractmethod async #

clear_members_for_user(user_id)

Remove the members cached for a specific user.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove the cached members for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages abstractmethod async #

clear_messages()

Empty the messages cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages_for_author abstractmethod async #

clear_messages_for_author(user_id)

Remove the messages cached for a specific author.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove the messages cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages_for_channel abstractmethod async #

clear_messages_for_channel(channel_id)

Remove the messages cached for a specific channel.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to remove the messages cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages_for_guild abstractmethod async #

clear_messages_for_guild(guild_id)

Remove the messages cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the messages cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_presences abstractmethod async #

clear_presences()

Empty the presences cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_presences_for_guild abstractmethod async #

clear_presences_for_guild(guild_id)

Remove the presences cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached presences for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_presences_for_user abstractmethod async #

clear_presences_for_user(user_id)

Remove the presences cached for a specific user.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove the cached presences for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_roles abstractmethod async #

clear_roles()

Empty the roles cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_roles_for_guild abstractmethod async #

clear_roles_for_guild(guild_id)

Remove the roles cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached roles for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_users abstractmethod async #

clear_users()

Empty the users cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_voice_states abstractmethod async #

clear_voice_states()

Empty the voice states cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_voice_states_for_channel abstractmethod async #

clear_voice_states_for_channel(channel_id)

Remove the voice states cached for a specified channel.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to remove the voice states cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_voice_states_for_guild abstractmethod async #

clear_voice_states_for_guild(guild_id)

Remove the voice states cached for a specified guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the voice states cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_emoji abstractmethod async #

delete_emoji(emoji_id)

Remove an emoji from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_guild abstractmethod async #

delete_guild(guild_id)

Remove a guild from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_guild_channel abstractmethod async #

delete_guild_channel(channel_id)

Remove a guild guild channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_invite abstractmethod async #

delete_invite(invite_code)

Remove an invite channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • invite_code (str) –

    The code of the invite to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_me abstractmethod async #

delete_me()

Remove the cached own user entry.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_member abstractmethod async #

delete_member(guild_id, user_id)

Remove a member from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached member for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_message abstractmethod async #

delete_message(message_id)

Remove a message from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_presence abstractmethod async #

delete_presence(guild_id, user_id)

Remove a presence from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached presence for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_role abstractmethod async #

delete_role(role_id)

Remove a role from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_user abstractmethod async #

delete_user(user_id)

Remove a user from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

delete_voice_state abstractmethod async #

delete_voice_state(guild_id, user_id)

Remove a voice state from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached voice state for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_emoji abstractmethod async #

get_emoji(emoji_id)

Get an emoji from the cache.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_guild abstractmethod async #

get_guild(guild_id)

Get a guild from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get from the cache.

Returns:

  • GatewayGuild

    The object of the guild fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_guild_channel abstractmethod async #

get_guild_channel(channel_id)

Get a guild channel from the cache.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_invite abstractmethod async #

get_invite(invite_code)

Get an invite from the cache.

Parameters:

  • invite_code (str) –

    The code of the invite to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_me abstractmethod async #

get_me()

Get the own user cache entry.

Returns:

  • OwnUser

    The object of the own user fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_member abstractmethod async #

get_member(guild_id, user_id)

Get a member from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached member for.

Returns:

  • Member

    The object of the member fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_message abstractmethod async #

get_message(message_id)

Get a message from the cache.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to get from the cache.

Returns:

  • Message

    The object of the message fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_presence abstractmethod async #

get_presence(guild_id, user_id)

Get a presence from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached presence for.

Returns:

  • MemberPresence

    The object of the presence fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_role abstractmethod async #

get_role(role_id)

Get a role from the cache.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to get from the cache.

Returns:

  • Role

    The object of the role fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_user abstractmethod async #

get_user(user_id)

Get a user from the cache.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to get from the cache.

Returns:

  • User

    The object of the user fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

get_voice_state abstractmethod async #

get_voice_state(guild_id, user_id)

Get a voice state from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached voice state for.

Returns:

  • VoiceState

    The object of the voice state fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_emojis abstractmethod #

iter_emojis()

Iterate over the emojis stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_emojis_for_guild abstractmethod #

iter_emojis_for_guild(guild_id)

Iterate over the emojis stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the emojis cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guild_channels abstractmethod #

iter_guild_channels()

Iterate over the guild channels stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guild_channels_for_guild abstractmethod #

iter_guild_channels_for_guild(guild_id)

Iterate over the guild channels stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the guild channels cached for it.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guilds abstractmethod #

iter_guilds()

Iterate over the guilds stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites abstractmethod #

iter_invites()

Iterate over the invites stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites_for_channel abstractmethod #

iter_invites_for_channel(channel_id)

Iterate over the invites stored in the cache for a specific channel.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to iterate over the invites cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites_for_guild abstractmethod #

iter_invites_for_guild(guild_id)

Iterate over the invites stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the invites cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members abstractmethod #

iter_members()

Iterate over the members stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members_for_guild abstractmethod #

iter_members_for_guild(guild_id)

Iterate over the members stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get the members cached for.

Returns:

  • CacheIterator[Member]

    An async iterator of the members stored in the cache for the specified guild.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members_for_user abstractmethod #

iter_members_for_user(user_id)

Iterate over the members stored in the cache for a specific user.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the guild to get the user cached for.

Returns:

  • CacheIterator[Member]

    An async iterator of the members stored in the cache for the specified user.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_message_for_channel abstractmethod #

iter_message_for_channel(channel_id)

Iterate over the messages stored in the cache for a specific channel.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to iterate over the messages cached for them.

Returns:

  • CacheIterator[Message]

    An async iterator of the messages stored in the cache for the specified channel.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages abstractmethod #

iter_messages()

Iterate over the messages stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages_for_author abstractmethod #

iter_messages_for_author(user_id)

Iterate over the messages stored in the cache for a specific author.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to iterate over the messages cached for them.

Returns:

  • CacheIterator[Message]

    An async iterator of the messages stored in the cache for the specified user.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages_for_guild abstractmethod #

iter_messages_for_guild(guild_id)

Iterate over the messages stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the messages cached for them.

Returns:

  • CacheIterator[Message]

    An async iterator of the messages stored in the cache for the specified guild.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences abstractmethod #

iter_presences()

Iterate over the presences stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences_for_guild abstractmethod #

iter_presences_for_guild(guild_id)

Iterate over the presences stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the cached presences for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences_for_user abstractmethod #

iter_presences_for_user(user_id)

Iterate over the presences stored in the cache for a specific user.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to iterate over the cached presences for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_roles abstractmethod #

iter_roles()

Iterate over the roles stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_roles_for_guild abstractmethod #

iter_roles_for_guild(guild_id)

Iterate over the roles stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get the roles cached for.

Returns:

  • CacheIterator[Role]

    An async iterator of the roles stored in the cache for the specified guild.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_users abstractmethod #

iter_users()

Iterate over the users stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states abstractmethod #

iter_voice_states()

Iterate over the voice states stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states_for_channel abstractmethod #

iter_voice_states_for_channel(channel_id)

Iterate over the voice states stored in the cache for a specific channel.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to iterate over the voice states cached for.

Returns:

  • CacheIterator[VoiceState]

    An async iterator of the voice states stored in the cache for the specified channel.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states_for_guild abstractmethod #

iter_voice_states_for_guild(guild_id)

Iterate over the voice states stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the voice states cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefEmojiCache #

Bases: EmojiCache, ABC

The traits of a implementation which supports a referential emoji cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_emojis abstractmethod async #

clear_emojis()

Empty the emoji cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_emojis_for_guild abstractmethod async #

clear_emojis_for_guild(guild_id)

Remove emojis belonging to a specific guild from the cache.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the emojis cached for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_emoji abstractmethod async #

delete_emoji(emoji_id)

Remove an emoji from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_emoji abstractmethod async #

get_emoji(emoji_id)

Get an emoji from the cache.

Parameters:

  • emoji_id (Snowflakeish) –

    The ID of the emoji to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_emojis abstractmethod #

iter_emojis()

Iterate over the emojis stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_emojis_for_guild abstractmethod #

iter_emojis_for_guild(guild_id)

Iterate over the emojis stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the emojis cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefGuildChannelCache #

Bases: GuildChannelCache, ABC

The traits of a implementation which supports a referential guild channel cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_guild_channels abstractmethod async #

clear_guild_channels()

Empty the guild channel cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_guild_channels_for_guild abstractmethod async #

clear_guild_channels_for_guild(guild_id)

Remove the guild channel cache store for the specified guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached channels for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_guild_channel abstractmethod async #

delete_guild_channel(channel_id)

Remove a guild guild channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_guild_channel abstractmethod async #

get_guild_channel(channel_id)

Get a guild channel from the cache.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the guild channel to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guild_channels abstractmethod #

iter_guild_channels()

Iterate over the guild channels stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_guild_channels_for_guild abstractmethod #

iter_guild_channels_for_guild(guild_id)

Iterate over the guild channels stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the guild channels cached for it.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefInviteCache #

Bases: InviteCache, ABC

The traits of a implementation which supports a referential invite cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_invites abstractmethod async #

clear_invites()

Empty the invites cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_invites_for_channel abstractmethod async #

clear_invites_for_channel(channel_id)

Remove invites cached for a specific channel..

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to remove the invites cached for it.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_invites_for_guild abstractmethod async #

clear_invites_for_guild(guild_id)

Remove invites cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the invites cached for it.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_invite abstractmethod async #

delete_invite(invite_code)

Remove an invite channel from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • invite_code (str) –

    The code of the invite to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_invite abstractmethod async #

get_invite(invite_code)

Get an invite from the cache.

Parameters:

  • invite_code (str) –

    The code of the invite to get from the cache.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites abstractmethod #

iter_invites()

Iterate over the invites stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites_for_channel abstractmethod #

iter_invites_for_channel(channel_id)

Iterate over the invites stored in the cache for a specific channel.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to iterate over the invites cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_invites_for_guild abstractmethod #

iter_invites_for_guild(guild_id)

Iterate over the invites stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the invites cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefMemberCache #

Bases: MemberCache, ABC

The traits of a implementation which supports a referential member cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_members abstractmethod async #

clear_members()

Empty the members cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_members_for_guild abstractmethod async #

clear_members_for_guild(guild_id)

Remove the members cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached members for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_members_for_user abstractmethod async #

clear_members_for_user(user_id)

Remove the members cached for a specific user.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove the cached members for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_member abstractmethod async #

delete_member(guild_id, user_id)

Remove a member from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached member for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_member abstractmethod async #

get_member(guild_id, user_id)

Get a member from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached member for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached member for.

Returns:

  • Member

    The object of the member fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members abstractmethod #

iter_members()

Iterate over the members stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members_for_guild abstractmethod #

iter_members_for_guild(guild_id)

Iterate over the members stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get the members cached for.

Returns:

  • CacheIterator[Member]

    An async iterator of the members stored in the cache for the specified guild.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_members_for_user abstractmethod #

iter_members_for_user(user_id)

Iterate over the members stored in the cache for a specific user.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the guild to get the user cached for.

Returns:

  • CacheIterator[Member]

    An async iterator of the members stored in the cache for the specified user.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefMessageCache #

Bases: MessageCache, ABC

The traits of a implementation which supports a referential message cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_messages abstractmethod async #

clear_messages()

Empty the messages cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages_for_author abstractmethod async #

clear_messages_for_author(user_id)

Remove the messages cached for a specific author.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove the messages cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages_for_channel abstractmethod async #

clear_messages_for_channel(channel_id)

Remove the messages cached for a specific channel.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to remove the messages cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_messages_for_guild abstractmethod async #

clear_messages_for_guild(guild_id)

Remove the messages cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the messages cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_message abstractmethod async #

delete_message(message_id)

Remove a message from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_message abstractmethod async #

get_message(message_id)

Get a message from the cache.

Parameters:

  • message_id (Snowflakeish) –

    The ID of the message to get from the cache.

Returns:

  • Message

    The object of the message fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_message_for_channel abstractmethod #

iter_message_for_channel(channel_id)

Iterate over the messages stored in the cache for a specific channel.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to iterate over the messages cached for them.

Returns:

  • CacheIterator[Message]

    An async iterator of the messages stored in the cache for the specified channel.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages abstractmethod #

iter_messages()

Iterate over the messages stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages_for_author abstractmethod #

iter_messages_for_author(user_id)

Iterate over the messages stored in the cache for a specific author.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to iterate over the messages cached for them.

Returns:

  • CacheIterator[Message]

    An async iterator of the messages stored in the cache for the specified user.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_messages_for_guild abstractmethod #

iter_messages_for_guild(guild_id)

Iterate over the messages stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the messages cached for them.

Returns:

  • CacheIterator[Message]

    An async iterator of the messages stored in the cache for the specified guild.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefPresenceCache #

Bases: PresenceCache, ABC

The traits of a implementation which supports a referential presence cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_presences abstractmethod async #

clear_presences()

Empty the presences cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_presences_for_guild abstractmethod async #

clear_presences_for_guild(guild_id)

Remove the presences cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached presences for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_presences_for_user abstractmethod async #

clear_presences_for_user(user_id)

Remove the presences cached for a specific user.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove the cached presences for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_presence abstractmethod async #

delete_presence(guild_id, user_id)

Remove a presence from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached presence for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_presence abstractmethod async #

get_presence(guild_id, user_id)

Get a presence from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached presence for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached presence for.

Returns:

  • MemberPresence

    The object of the presence fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences abstractmethod #

iter_presences()

Iterate over the presences stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences_for_guild abstractmethod #

iter_presences_for_guild(guild_id)

Iterate over the presences stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the cached presences for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_presences_for_user abstractmethod #

iter_presences_for_user(user_id)

Iterate over the presences stored in the cache for a specific user.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to iterate over the cached presences for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefRoleCache #

Bases: RoleCache, ABC

The traits of a implementation which supports a referential role cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_roles abstractmethod async #

clear_roles()

Empty the roles cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_roles_for_guild abstractmethod async #

clear_roles_for_guild(guild_id)

Remove the roles cached for a specific guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the cached roles for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_role abstractmethod async #

delete_role(role_id)

Remove a role from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_role abstractmethod async #

get_role(role_id)

Get a role from the cache.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to get from the cache.

Returns:

  • Role

    The object of the role fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_roles abstractmethod #

iter_roles()

Iterate over the roles stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_roles_for_guild abstractmethod #

iter_roles_for_guild(guild_id)

Iterate over the roles stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get the roles cached for.

Returns:

  • CacheIterator[Role]

    An async iterator of the roles stored in the cache for the specified guild.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RefVoiceStateCache #

Bases: VoiceStateCache, ABC

The traits of a implementation which supports a referential voice state cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_voice_states abstractmethod async #

clear_voice_states()

Empty the voice states cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_voice_states_for_channel abstractmethod async #

clear_voice_states_for_channel(channel_id)

Remove the voice states cached for a specified channel.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to remove the voice states cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

clear_voice_states_for_guild abstractmethod async #

clear_voice_states_for_guild(guild_id)

Remove the voice states cached for a specified guild.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove the voice states cached for.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_voice_state abstractmethod async #

delete_voice_state(guild_id, user_id)

Remove a voice state from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached voice state for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_voice_state abstractmethod async #

get_voice_state(guild_id, user_id)

Get a voice state from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached voice state for.

Returns:

  • VoiceState

    The object of the voice state fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states abstractmethod #

iter_voice_states()

Iterate over the voice states stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states_for_channel abstractmethod #

iter_voice_states_for_channel(channel_id)

Iterate over the voice states stored in the cache for a specific channel.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • channel_id (Snowflakeish) –

    The ID of the channel to iterate over the voice states cached for.

Returns:

  • CacheIterator[VoiceState]

    An async iterator of the voice states stored in the cache for the specified channel.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states_for_guild abstractmethod #

iter_voice_states_for_guild(guild_id)

Iterate over the voice states stored in the cache for a specific guild.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to iterate over the voice states cached for.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

Resource #

Bases: ABC

The basic interface which all cache resources should implement.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

RoleCache #

Bases: Resource, ABC

The traits of a implementation which supports a role cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_roles abstractmethod async #

clear_roles()

Empty the roles cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_role abstractmethod async #

delete_role(role_id)

Remove a role from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_role abstractmethod async #

get_role(role_id)

Get a role from the cache.

Parameters:

  • role_id (Snowflakeish) –

    The ID of the role to get from the cache.

Returns:

  • Role

    The object of the role fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_roles abstractmethod #

iter_roles()

Iterate over the roles stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

UserCache #

Bases: Resource, ABC

The traits of a cache implementation which supports a user cache.

Note

Unlike other resources, user doesn't have any events which directly update it and may only be updated through event listeners when resources which reference it are also included.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_users abstractmethod async #

clear_users()

Empty the users cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_user abstractmethod async #

delete_user(user_id)

Remove a user from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to remove from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_user abstractmethod async #

get_user(user_id)

Get a user from the cache.

Parameters:

  • user_id (Snowflakeish) –

    The ID of the user to get from the cache.

Returns:

  • User

    The object of the user fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_users abstractmethod #

iter_users()

Iterate over the users stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.

VoiceStateCache #

Bases: Resource, ABC

The traits of a implementation which supports a voice state cache.

is_alive abstractmethod property #

is_alive

Whether this client is alive.

clear_voice_states abstractmethod async #

clear_voice_states()

Empty the voice states cache store.

Note

There is no guarantee that this operation will be complete before the returned coroutine finishes.

Raises:

  • BackendError

    Raised when this call failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

close abstractmethod async #

close()

Close the resource(s) and allow them to disconnect from their relevant backend(s).

Note

This should pass without raising if called on an already closed resource.

delete_voice_state abstractmethod async #

delete_voice_state(guild_id, user_id)

Remove a voice state from the cache.

Note

Delete methods do not raise sake.errors.EntryNotFound when the targeted entity doesn't exist.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to remove a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to remove a cached voice state for.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

get_voice_state abstractmethod async #

get_voice_state(guild_id, user_id)

Get a voice state from the cache.

Parameters:

  • guild_id (Snowflakeish) –

    The ID of the guild to get a cached voice state for.

  • user_id (Snowflakeish) –

    The ID of the user to get a cached voice state for.

Returns:

  • VoiceState

    The object of the voice state fetched from the cache.

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • EntryNotFound

    Raised when the targeted entity wasn't found.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

iter_voice_states abstractmethod #

iter_voice_states()

Iterate over the voice states stored in the cache.

Note

Errors won't be raised by the initial call to this method but rather while iterating over the returned asynchronous iterator.

Returns:

Raises:

  • BackendError

    Raised when this failed to communicate with the cache's backend. This may be a sign of underlying network or database issues.

  • InvalidDataFound

    Raised when the data retrieved from the backend datastore was either invalid for this implementation or corrupt. This may be a sign of multiple sake versions or implementations being used with the same backend store.

open abstractmethod async #

open()

Startup the resource(s) and allow them to connect to their relevant backend(s).

Note

This should pass without raising if called on an already opened resource.