pub struct CreateGlobalCommand<'a> { /* private fields */ }
Expand description
Create a new global command.
Implementations§
source§impl<'a> CreateGlobalCommand<'a>
impl<'a> CreateGlobalCommand<'a>
sourcepub fn chat_input(
self,
name: &'a str,
description: &'a str,
) -> CreateGlobalChatInputCommand<'a>
pub fn chat_input( self, name: &'a str, description: &'a str, ) -> CreateGlobalChatInputCommand<'a>
Create a new chat input global command.
The command name must only contain alphanumeric characters and lowercase
variants must be used where possible. Special characters -
and _
are
allowed. The description must be between 1 and 100 characters in length.
Creating a command with the same name as an already-existing global command will overwrite the old command. See Discord Docs/Create Global Application Command.
§Errors
Returns an error of type NameLengthInvalid
or NameCharacterInvalid
if the command name is invalid.
Returns an error of type DescriptionInvalid
if the
command description is not between 1 and 100 characters.
sourcepub fn message(self, name: &'a str) -> CreateGlobalMessageCommand<'a>
pub fn message(self, name: &'a str) -> CreateGlobalMessageCommand<'a>
Create a new message global command.
Creating a command with the same name as an already-existing global command will overwrite the old command. See Discord Docs/Create Global Application Command.
§Errors
Returns an error of type NameLengthInvalid
if the command name is
not between 1 and 32 characters.
sourcepub fn user(self, name: &'a str) -> CreateGlobalUserCommand<'a>
pub fn user(self, name: &'a str) -> CreateGlobalUserCommand<'a>
Create a new user global command.
Creating a command with the same name as an already-existing global command will overwrite the old command. See Discord Docs/Create Global Application Command.
§Errors
Returns an error of type NameLengthInvalid
if the command name is
not between 1 and 32 characters.