Remedy.Cache (Remedy v0.6.7) View Source

Functions for interracting with the cache.

The cache is populated only by events received from the gateway, it is not updated from interractions with the REST api.

Link to this section Summary

Functions

Fetch a ban from the Cache by user_id & guild_id

Unsafe proxy definition for fetch_ban/2.

Fetch a channel from the cache.

Unsafe proxy definition for fetch_channel/1.

Fetch a guild from the cache

Unsafe proxy definition for fetch_guild/1.

Fetch an integration by ID.

Fetch a role from the cache.

Unsafe proxy definition for fetch_role/1.

Fetch a user from the cache.

Unsafe proxy definition for fetch_user/1.

List all bans

Unsafe proxy definition for list_bans/0.

List channels from the cache.

Unsafe proxy definition for list_channels/1.

List all bans associated with a guild.

Unsafe proxy definition for list_guild_bans/1.

List Members

List all bans associated with a user.

Unsafe proxy definition for list_user_bans/1.

Unsafe proxy definition for update_role/2.

Returns True/False to the user being banned from a guild.

Link to this section Types

Specs

attrs() :: map()

Specs

changeset() :: Ecto.Changeset.t()

Specs

reason() :: String.t()

Specs

snowflake() :: Snowflake.t()

Link to this section Functions

Link to this function

create_interaction(attrs)

View Source
Link to this function

fetch_ban(guild_id, user_id)

View Source

Specs

fetch_ban(snowflake(), snowflake()) ::
  {:error, reason()} | {:ok, Remedy.Schema.Ban.t()}

Fetch a ban from the Cache by user_id & guild_id

Link to this function

fetch_ban!(guild_id, user_id)

View Source

Unsafe proxy definition for fetch_ban/2.

Specs

fetch_channel(snowflake()) ::
  {:error, reason()} | {:ok, Remedy.Schema.Channel.t()}

Fetch a channel from the cache.

Unsafe proxy definition for fetch_channel/1.

Fetch a guild from the cache

Unsafe proxy definition for fetch_guild/1.

Link to this function

fetch_integration(integration_id)

View Source

Fetch an integration by ID.

Specs

fetch_role(any()) :: {:error, :not_found} | {:ok, Remedy.Schema.Role.t()}

Fetch a role from the cache.

Returns {:ok, %Role{}} or {:error, reason}

Unsafe proxy definition for fetch_role/1.

Fetch a user from the cache.

Returns {:ok, %User{}} or {:error, reason}

Unsafe proxy definition for fetch_user/1.

Link to this function

get_ban(guild_id, user_id)

View Source

Specs

get_ban(snowflake(), snowflake()) :: nil | Remedy.Schema.Ban.t()
Link to this function

get_member(guild_id, user_id)

View Source

Specs

list_bans() :: {:error, reason()} | {:ok, [Remedy.Schema.Ban.t()]}

List all bans

Unsafe proxy definition for list_bans/0.

Link to this function

list_channels(guild_id \\ nil)

View Source

Specs

list_channels(snowflake()) ::
  {:error, term()} | {:ok, [Remedy.Schema.Channel.t()]}

List channels from the cache.

Link to this function

list_channels!(guild_id)

View Source

Unsafe proxy definition for list_channels/1.

Link to this function

list_guild_bans(guild_id)

View Source

Specs

list_guild_bans(snowflake()) ::
  {:error, reason()} | {:ok, [Remedy.Schema.Ban.t()]}

List all bans associated with a guild.

Link to this function

list_guild_bans!(guild_id)

View Source

Unsafe proxy definition for list_guild_bans/1.

List Members

Specs

list_user_bans(snowflake()) ::
  {:error, reason()} | {:ok, [Remedy.Schema.Ban.t()]}

List all bans associated with a user.

Link to this function

list_user_bans!(user_id)

View Source

Unsafe proxy definition for list_user_bans/1.

Link to this function

remove_message_reactions(message_id)

View Source

Specs

remove_message_reactions(snowflake()) ::
  {:ok, Remedy.Schema.Message.t()} | {:error, reason()}
Link to this function

update_guild_emojis(guild_id, params)

View Source
Link to this function

update_guild_stickers(guild_id, params)

View Source

Unsafe proxy definition for update_role/2.

Link to this function

user_banned?(guild_id, user_id)

View Source

Specs

user_banned?(any(), any()) :: true | false

Returns True/False to the user being banned from a guild.