View Source Nostrum.Cache.GuildCache.ETS (Nostrum v0.8.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.

Link to this section 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.

Set up the cache's ETS table.

Decrement the guild member count by one.

Increment the guild member count by one.

Get a QLC query handle for the guild cache.

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.

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.

Link to this section 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

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

query_handle()

View Source (since 0.8.0)
@spec query_handle() :: :qlc.query_handle()

Get a QLC query handle for the guild cache.

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.

@spec tabname() :: atom()

Retrieve the ETS table name used for the cache.

Link to this function

update(payload)

View Source (since 0.5.0)

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.