pub struct CreateGlobalChatInputCommand<'a> { /* private fields */ }Expand description
Create a new chat input global command.
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.
Implementations§
Source§impl<'a> CreateGlobalChatInputCommand<'a>
impl<'a> CreateGlobalChatInputCommand<'a>
Sourcepub fn command_options(self, options: &'a [CommandOption]) -> Self
pub fn command_options(self, options: &'a [CommandOption]) -> Self
Add a list of command options.
Required command options must be added before optional options.
§Errors
Returns an error of type OptionsRequiredFirst if a required option
was added after an optional option. The problem option’s index is
provided.
Sourcepub fn default_member_permissions(self, default: Permissions) -> Self
pub fn default_member_permissions(self, default: Permissions) -> Self
Default permissions required for a member to run the command.
Defaults to None.
Sourcepub fn dm_permission(self, dm_permission: bool) -> Self
pub fn dm_permission(self, dm_permission: bool) -> Self
Set whether the command is available in DMs.
Defaults to None.
Sourcepub fn description_localizations(
self,
localizations: &'a HashMap<String, String>,
) -> Self
pub fn description_localizations( self, localizations: &'a HashMap<String, String>, ) -> Self
Set the localization dictionary for the command description.
Defaults to None.
§Errors
Returns an error of type DescriptionInvalid if the description is
invalid.
Sourcepub fn name_localizations(
self,
localizations: &'a HashMap<String, String>,
) -> Self
pub fn name_localizations( self, localizations: &'a HashMap<String, String>, ) -> Self
Set the localization dictionary for the command name.
Defaults to None.
§Errors
Returns an error of type NameLengthInvalid if the length is invalid.
Returns an error of type NameCharacterInvalid if the name contains a
non-alphanumeric character or an uppercase character for which a
lowercase variant exists.