View Source Nostrum.Cache.GuildCache.ETS (Nostrum v0.10.0)
An ETS-based cache for guilds.
The supervisor defined by this module will set up the ETS table associated with it.
The default table name under which guilds are cached is nostrum_guilds
.
In addition to the cache behaviour implementations provided by this module,
you can also call regular ETS table methods on it, such as :ets.info
.
Note that users should not call the functions not related to this specific
implementation of the cache directly. Instead, call the functions of
Nostrum.Cache.GuildCache
directly, which will dispatch to the configured
cache.
Summary
Functions
Create the given channel for the given guild in the cache.
Delete the channel from the given guild in the cache.
Update the channel on the given guild in the cache.
Returns a specification to start this module under a supervisor.
Create the given guild in the cache.
Delete the given guild from the cache.
Update the emoji list for the given guild in the cache.
Get a guild from the cache.
Set up the cache's ETS table.
Decrement the guild member count by one.
Increment the guild member count by one.
Create the given role in the given guild in the cache.
Delete the given role from the given guild in the cache.
Update the given role in the given guild in the cache.
Start the supervisor.
Update the sticker list for the given guild in the cache.
Retrieve the ETS table name used for the cache.
Update the given guild in the cache.
Update guild voice states with the given voice state in the cache.
Functions
@spec channel_create(Nostrum.Struct.Guild.id(), map()) :: Nostrum.Struct.Channel.t()
Create the given channel for the given guild in the cache.
@spec channel_delete(Nostrum.Struct.Guild.id(), Nostrum.Struct.Channel.id()) :: Nostrum.Struct.Channel.t() | :noop
Delete the channel from the given guild in the cache.
@spec channel_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Channel.t(), Nostrum.Struct.Channel.t()}
Update the channel on the given guild in the cache.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec create(map()) :: Nostrum.Struct.Guild.t()
Create the given guild in the cache.
@spec delete(Nostrum.Struct.Guild.id()) :: Nostrum.Struct.Guild.t() | nil
Delete the given guild from the cache.
@spec emoji_update(Nostrum.Struct.Guild.id(), [map()]) :: {[Nostrum.Struct.Emoji.t()], [Nostrum.Struct.Emoji.t()]}
Update the emoji list for the given guild in the cache.
@spec get(Nostrum.Struct.Guild.id()) :: {:ok, Nostrum.Struct.Guild.t()} | {:error, :not_found}
Get a guild from the cache.
Set up the cache's ETS table.
@spec member_count_down(Nostrum.Struct.Guild.id()) :: true
Decrement the guild member count by one.
@spec member_count_up(Nostrum.Struct.Guild.id()) :: true
Increment the guild member count by one.
@spec role_create(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t()}
Create the given role in the given guild in the cache.
@spec role_delete(Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.id()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t()} | :noop
Delete the given role from the given guild in the cache.
@spec role_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), Nostrum.Struct.Guild.Role.t(), Nostrum.Struct.Guild.Role.t()}
Update the given role in the given guild in the cache.
Start the supervisor.
@spec stickers_update(Nostrum.Struct.Guild.id(), [map()]) :: {[Nostrum.Struct.Sticker.t()], [Nostrum.Struct.Sticker.t()]}
Update the sticker list for the given guild in the cache.
@spec tabname() :: atom()
Retrieve the ETS table name used for the cache.
@spec update(map()) :: {Nostrum.Struct.Guild.t() | nil, Nostrum.Struct.Guild.t()}
Update the given guild in the cache.
@spec voice_state_update(Nostrum.Struct.Guild.id(), map()) :: {Nostrum.Struct.Guild.id(), [map()]}
Update guild voice states with the given voice state in the cache.