Struct serenity::framework::standard::Command
[−]
[src]
pub struct Command { pub checks: Vec<Box<Fn(&mut Context, &Message, &mut Args, &Arc<Command>) -> bool + Send + Sync + 'static>>, pub exec: CommandType, pub bucket: Option<String>, pub desc: Option<String>, pub example: Option<String>, pub usage: Option<String>, pub min_args: Option<i32>, pub max_args: Option<i32>, pub required_permissions: Permissions, pub allowed_roles: Vec<String>, pub help_available: bool, pub dm_only: bool, pub guild_only: bool, pub owners_only: bool, // some fields omitted }
Command struct used to store commands internally.
Fields
checks: Vec<Box<Fn(&mut Context, &Message, &mut Args, &Arc<Command>) -> bool + Send + Sync + 'static>>
A set of checks to be called prior to executing the command. The checks
will short-circuit on the first check that returns false
.
exec: CommandType
Function called when the command is called.
bucket: Option<String>
Ratelimit bucket.
desc: Option<String>
Command description, used by other commands.
example: Option<String>
Example arguments, used by other commands.
usage: Option<String>
Command usage schema, used by other commands.
min_args: Option<i32>
Minumum amount of arguments that should be passed.
max_args: Option<i32>
Maximum amount of arguments that can be passed.
required_permissions: Permissions
Permissions required to use this command.
allowed_roles: Vec<String>
Roles allowed to use this command.
help_available: bool
Whether command should be displayed in help list or not, used by other commands.
dm_only: bool
Whether command can be used only privately or not.
guild_only: bool
Whether command can be used only in guilds or not.
owners_only: bool
Whether command can only be used by owners or not.