Struct twilight_interactions::command::ApplicationCommandData [−][src]
pub struct ApplicationCommandData {
pub name: String,
pub description: String,
pub options: Vec<CommandOption>,
pub default_permission: bool,
}Expand description
Data sent to Discord to create a command.
If the http feature is enabled, this type provide
two methods to create the command.
Fields
name: StringName of the command. It must be 32 characters or less.
description: StringDescription of the option. It must be 100 characters or less.
options: Vec<CommandOption>List of command options.
default_permission: boolWhether the command is enabled by default when the app is added to a guild.
Implementations
pub fn create_global_command(
&self,
client: &Client
) -> Result<ResponseFuture<Command>, InteractionError>
This is supported on crate feature http only.
pub fn create_global_command(
&self,
client: &Client
) -> Result<ResponseFuture<Command>, InteractionError>
http only.Create a global application command from this ApplicationCommandData.
pub fn create_guild_command(
&self,
client: &Client,
guild_id: GuildId
) -> Result<ResponseFuture<Command>, InteractionError>
This is supported on crate feature http only.
pub fn create_guild_command(
&self,
client: &Client,
guild_id: GuildId
) -> Result<ResponseFuture<Command>, InteractionError>
http only.Create a guild application command from this ApplicationCommandData.
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for ApplicationCommandData
impl Send for ApplicationCommandData
impl Sync for ApplicationCommandData
impl Unpin for ApplicationCommandData
impl UnwindSafe for ApplicationCommandData
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more