pub struct Command {Show 15 fields
pub application_id: Option<Id<ApplicationMarker>>,
pub contexts: Option<Vec<InteractionContextType>>,
pub default_member_permissions: Option<Permissions>,
pub dm_permission: Option<bool>,
pub description: String,
pub description_localizations: Option<HashMap<String, String>>,
pub guild_id: Option<Id<GuildMarker>>,
pub id: Option<Id<CommandMarker>>,
pub integration_types: Option<Vec<ApplicationIntegrationType>>,
pub kind: CommandType,
pub name: String,
pub name_localizations: Option<HashMap<String, String>>,
pub nsfw: Option<bool>,
pub options: Vec<CommandOption>,
pub version: Id<CommandVersionMarker>,
}
Expand description
Data sent to Discord to create a command.
CommandOption
s that are required must be listed before optional ones.
Command names must be lower case, matching the Regex ^[\w-]{1,32}$
. See
Discord Docs/Application Command Object.
Fields§
§application_id: Option<Id<ApplicationMarker>>
§contexts: Option<Vec<InteractionContextType>>
§default_member_permissions: Option<Permissions>
Default permissions required for a member to run the command.
Setting this Permissions::empty()
will prohibit anyone from running
the command, except for guild administrators.
dm_permission: Option<bool>
Whether the command is available in DMs.
This is only relevant for globally-scoped commands. By default, commands are visible in DMs.
description: String
§description_localizations: Option<HashMap<String, String>>
Localization dictionary for the description
field.
guild_id: Option<Id<GuildMarker>>
Guild ID of the command, if not global.
id: Option<Id<CommandMarker>>
§integration_types: Option<Vec<ApplicationIntegrationType>>
§kind: CommandType
§name: String
§name_localizations: Option<HashMap<String, String>>
Localization dictionary for the name
field.
Keys should be valid locales. See Discord Docs/Locales, Discord Docs/Localization.
nsfw: Option<bool>
Whether the command is age-restricted.
Defaults to false.
options: Vec<CommandOption>
§version: Id<CommandVersionMarker>
Autoincrementing version identifier.