Nostrum.Api.create_global_application_command
You're seeing just the function
create_global_application_command
, go back to Nostrum.Api module for more information.
Link to this function
create_global_application_command(application_id \\ Me.get().id, command)
View SourceSpecs
create_global_application_command(Nostrum.Struct.User.id(), map()) :: {:ok, map()} | error()
Create a new global application command.
The new command will be available on all guilds in around an hour.
If you want to test commands, use create_guild_application_command/2
instead,
as commands will become available instantly there.
If an existing command with the same name exists, it will be overwritten.
Parameters
application_id
: Application ID for which to create the command. If not given, this will be fetched fromMe
.command
: Command configuration, see the linked API documentation for reference.
Return value
The created command. See the official reference: https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
Example
Nostrum.Api.create_application_command(
%{name: "edit", description: "ed, man! man, ed", options: []}
)