discord-interactions

Client Cache

class interactions.api.cache.Item(id: str, value: Any)

A class representing the defined item in a stored dataset.

Variables
  • id (str) – The ID of the item.

  • value (typing.Any) – The item itself.

  • type (typing.Type) – The ID type representation.

class interactions.api.cache.Storage

A class representing a set of items stored as a cache state.

Variables

values (typing.List[interactions.api.cache.Item]) – The list of items stored.

add(item: interactions.api.cache.Item) collections.OrderedDict

Adds a new item to the storage.

Parameters

item (interactions.api.cache.Item) – The item to add.

Returns

typing.List[interactions.api.cache.Item]

get(id: str) Optional[interactions.api.cache.Item]

Gets an item from the storage.

Parameters

id (str) – The ID of the item.

Returns

typing.Optional[interactions.api.cache.Item]

class interactions.api.cache.Cache

A class representing the cache. This cache collects all of the HTTP requests made for the represented instances of the class.

Variables
  • dms (interactions.api.cache.Cache) – The cached Direct Messages.

  • self_guilds (interactions.api.cache.Cache) – The cached guilds upon gateway connection.

  • guilds (interactions.api.cache.Cache) – The cached guilds after ready.

  • channels (interactions.api.cache.Cache) – The cached channels of guilds.

  • roles (interactions.api.cache.Cache) – The cached roles of guilds.

  • members (interactions.api.cache.Cache) – The cached members of guilds and threads.

  • messages (interactions.api.cache.Cache) – The cached messages of DMs and channels.

  • interactions (interactions.api.cache.Cache) – The cached interactions upon interaction.