Struct twilight_http::request::application::command::create_guild_command::CreateGuildChatInputCommand
source · pub struct CreateGuildChatInputCommand<'a> { /* private fields */ }
Expand description
Create a chat input command in a guild.
The description must be between 1 and 100 characters in length. Creating a guild command with the same name as an already-existing guild command in the same guild will overwrite the old command. See Discord Docs/Create Global Application Command.
Implementations§
source§impl<'a> CreateGuildChatInputCommand<'a>
impl<'a> CreateGuildChatInputCommand<'a>
sourcepub fn command_options(
self,
options: &'a [CommandOption]
) -> Result<Self, CommandValidationError>
pub fn command_options( self, options: &'a [CommandOption] ) -> Result<Self, CommandValidationError>
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 const fn default_member_permissions(self, default: Permissions) -> Self
pub const fn default_member_permissions(self, default: Permissions) -> Self
Default permissions required for a member to run the command.
Defaults to None
.
sourcepub fn description_localizations(
self,
localizations: &'a HashMap<String, String>
) -> Result<Self, CommandValidationError>
pub fn description_localizations( self, localizations: &'a HashMap<String, String> ) -> Result<Self, CommandValidationError>
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>
) -> Result<Self, CommandValidationError>
pub fn name_localizations( self, localizations: &'a HashMap<String, String> ) -> Result<Self, CommandValidationError>
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.