Struct twilight_model::application::command::Command
source · [−]pub struct Command {
pub application_id: Option<Id<ApplicationMarker>>,
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 kind: CommandType,
pub name: String,
pub name_localizations: Option<HashMap<String, String>>,
pub options: Vec<CommandOption>,
pub version: Id<CommandVersionMarker>,
}Expand description
Data sent to Discord to create a command.
CommandOptions 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.
This struct has an associated builder in the twilight-util crate.
Fields
application_id: Option<Id<ApplicationMarker>>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: Stringdescription_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>>kind: CommandTypename: Stringname_localizations: Option<HashMap<String, String>>Localization dictionary for the name field.
Keys should be valid locales. See Discord Docs/Locales, Discord Docs/Localization.
options: Vec<CommandOption>version: Id<CommandVersionMarker>Autoincrementing version identifier.