REST API endpoints for Discord application commands.
All functions return {:ok, result} or {:error, reason}.
Summary
Functions
Bulk overwrites all global application commands.
Bulk overwrites all guild application commands.
Creates a global application command.
Creates a guild application command (available instantly).
Deletes a global application command.
Deletes a guild application command.
Updates a global application command.
Updates a guild application command.
Fetches all global application commands.
Fetches all guild application commands.
Gets who may use each of the app's commands in a guild — every command with permissions set
there, and the app-wide entry whose id is the application id.
Gets who may use one of the app's commands in a guild. See permissions/1.
Functions
@spec bulk_overwrite_global([map() | EDA.Command.t()]) :: {:ok, [map()]} | {:error, term()}
Bulk overwrites all global application commands.
@spec bulk_overwrite_guild(String.t() | integer(), [map() | EDA.Command.t()]) :: {:ok, [map()]} | {:error, term()}
Bulk overwrites all guild application commands.
@spec create_global(map() | EDA.Command.t()) :: {:ok, map()} | {:error, term()}
Creates a global application command.
@spec create_guild(String.t() | integer(), map() | EDA.Command.t()) :: {:ok, map()} | {:error, term()}
Creates a guild application command (available instantly).
Deletes a global application command.
Deletes a guild application command.
Updates a global application command.
@spec edit_guild(String.t() | integer(), String.t() | integer(), map()) :: {:ok, map()} | {:error, term()}
Updates a guild application command.
Fetches all global application commands.
Fetches all guild application commands.
Gets who may use each of the app's commands in a guild — every command with permissions set
there, and the app-wide entry whose id is the application id.
EDA.Command.Permissions.from_raw/1 parses each. Setting them needs a user's OAuth2 token, not
a bot's, so there is no write counterpart here.
@spec permissions(String.t() | integer(), String.t() | integer()) :: {:ok, map()} | {:error, term()}
Gets who may use one of the app's commands in a guild. See permissions/1.