REST API endpoints for Discord guild emojis.
All functions return {:ok, result} or {:error, reason}.
Summary
Functions
Creates a guild emoji.
Creates an application emoji.
Deletes a guild emoji.
Deletes an application emoji.
Gets a guild emoji by ID. Returns an EDA.Emoji struct.
Gets one of the application's emojis.
Lists all emojis for a guild. Returns EDA.Emoji structs.
Lists the application's emojis. Returns EDA.Emoji structs.
Modifies a guild emoji.
Renames an application emoji — the only thing that can change about one.
Functions
@spec create(String.t() | integer(), map()) :: {:ok, EDA.Emoji.t()} | {:error, term()}
Creates a guild emoji.
Parameters
guild_id- The guild IDparams- Map with::name- Emoji name (required):image- Base64-encoded image data URI (required):roles- List of role IDs allowed to use this emoji (optional)
@spec create_application(String.t(), String.t() | binary()) :: {:ok, EDA.Emoji.t()} | {:error, term()}
Creates an application emoji.
image is a path, raw PNG/JPEG/GIF bytes or a data URI — see EDA.ImageData. Discord takes a
128×128 image of at most 256 KiB, and refuses a larger one with a bare 400.
Deletes a guild emoji.
Deletes an application emoji.
@spec get(String.t() | integer(), String.t() | integer()) :: {:ok, EDA.Emoji.t()} | {:error, term()}
Gets a guild emoji by ID. Returns an EDA.Emoji struct.
@spec get_application(String.t() | integer()) :: {:ok, EDA.Emoji.t()} | {:error, term()}
Gets one of the application's emojis.
@spec list(String.t() | integer()) :: {:ok, [EDA.Emoji.t()]} | {:error, term()}
Lists all emojis for a guild. Returns EDA.Emoji structs.
@spec list_application() :: {:ok, [EDA.Emoji.t()]} | {:error, term()}
Lists the application's emojis. Returns EDA.Emoji structs.
@spec modify(String.t() | integer(), String.t() | integer(), map()) :: {:ok, EDA.Emoji.t()} | {:error, term()}
Modifies a guild emoji.
@spec modify_application(String.t() | integer(), String.t()) :: {:ok, EDA.Emoji.t()} | {:error, term()}
Renames an application emoji — the only thing that can change about one.