SlashCommandBuilder class
A slash command, can only be instantiated through a method on Interactions
- Inheritance
-
- Object
- Builder
- SlashCommandBuilder
Constructors
-
SlashCommandBuilder(String name, String? description, List<
CommandOptionBuilder> options, {bool defaultPermissions = true, List<ICommandPermissionBuilder> ? permissions, Snowflake? guild, SlashCommandType type = SlashCommandType.chat}) - A slash command, can only be instantiated through a method on Interactions
Properties
- defaultPermissions → bool
-
If people can use the command by default or if they need permissions to use it.
final
- description → String?
-
Command description shown to the user in the Slash Command UI
final
- guild ↔ Snowflake?
-
The guild that the slash Command is registered in. This can be null if its a global command.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Command name to be shown to the user in the Slash Command UI
final
-
options
↔ List<
CommandOptionBuilder> -
The arguments that the command takes
getter/setter pair
-
permissions
↔ List<
ICommandPermissionBuilder> ? -
Permission overrides for the command
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type ↔ SlashCommandType
-
Target of slash command if different that SlashCommandTarget.chat - slash command will
become context menu in appropriate context
getter/setter pair
Methods
-
addPermission(
ICommandPermissionBuilder permission) → void - Register a permission
-
build(
) → RawApiMap -
Returns built response for api
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerHandler(
SlashCommandHandler handler) → void - Registers handler for command. Note command cannot have handler if there are options present
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited