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

Link to this function

channel_create(guild_id, channel)

View Source (since 0.5.0)
@spec channel_create(Nostrum.Struct.Guild.id(), map()) :: Nostrum.Struct.Channel.t()

Create the given channel for the given guild in the cache.

Link to this function

channel_delete(guild_id, channel_id)

View Source (since 0.5.0)

Delete the channel from the given guild in the cache.

Link to this function

channel_update(guild_id, channel)

View Source (since 0.5.0)

Update the channel on the given guild in the cache.

Link to this function

child_spec(init_arg)

View Source (since 0.5.0)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

create(payload)

View Source (since 0.5.0)
@spec create(map()) :: Nostrum.Struct.Guild.t()

Create the given guild in the cache.

Link to this function

delete(guild_id)

View Source (since 0.5.0)
@spec delete(Nostrum.Struct.Guild.id()) :: Nostrum.Struct.Guild.t() | nil

Delete the given guild from the cache.

Link to this function

emoji_update(guild_id, emojis)

View Source (since 0.5.0)

Update the emoji list for the given guild in the cache.

Link to this function

get(guild_id)

View Source (since 0.5.0)
@spec get(Nostrum.Struct.Guild.id()) ::
  {:ok, Nostrum.Struct.Guild.t()} | {:error, :not_found}

Get a guild from the cache.

Link to this function

init(init_arg)

View Source (since 0.5.0)

Set up the cache's ETS table.

Link to this function

member_count_down(guild_id)

View Source (since 0.7.0)
@spec member_count_down(Nostrum.Struct.Guild.id()) :: true

Decrement the guild member count by one.

Link to this function

member_count_up(guild_id)

View Source (since 0.7.0)
@spec member_count_up(Nostrum.Struct.Guild.id()) :: true

Increment the guild member count by one.

Link to this function

role_create(guild_id, role)

View Source (since 0.5.0)

Create the given role in the given guild in the cache.

Link to this function

role_delete(guild_id, role_id)

View Source (since 0.5.0)

Delete the given role from the given guild in the cache.

Link to this function

role_update(guild_id, role)

View Source (since 0.5.0)

Update the given role in the given guild in the cache.

Link to this function

start_link(init_arg)

View Source (since 0.5.0)

Start the supervisor.

Link to this function

stickers_update(guild_id, stickers)

View Source (since 0.5.0)

Update the sticker list for the given guild in the cache.

@spec tabname() :: atom()

Retrieve the ETS table name used for the cache.

Link to this function

update(payload)

View Source (since 0.5.0)
@spec update(map()) :: {Nostrum.Struct.Guild.t() | nil, Nostrum.Struct.Guild.t()}

Update the given guild in the cache.

Link to this function

voice_state_update(guild_id, payload)

View Source (since 0.5.0)
@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.