SlashCommandBuilder class Null safety

A slash command, can only be instantiated through a method on Interactions

Inheritance

Constructors

SlashCommandBuilder(String name, String? description, List<CommandOptionBuilder> options, {bool canBeUsedInDm = true, int? requiredPermissions, Snowflake? guild, SlashCommandType type = SlashCommandType.chat, bool defaultPermissions = true, List<CommandPermissionBuilderAbstract>? permissions})
A slash command, can only be instantiated through a method on Interactions

Properties

canBeUsedInDm bool
Whether this slash command can be used in a DM channel with the bot.
final
defaultPermissions bool
If people can use the command by default or if they need permissions to use it.
@Deprecated('Use canBeUsedInDm and requiresPermissions instead'), 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.
read / write
handler SlashCommandHandler?
Handler for SlashCommandBuilder
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
id Snowflake
read-only
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
read / write
permissions List<CommandPermissionBuilderAbstract>?
Permission overrides for the command
@Deprecated('Use canBeUsedInDm and requiresPermissions instead'), read / write
requiredPermissions int?
A set of permissions required by users in guilds to execute this command. [...]
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
type SlashCommandType
Target of slash command if different that SlashCommandTarget.chat - slash command will become context menu in appropriate context
read / write

Methods

addPermission(CommandPermissionBuilderAbstract permission) → void
Register a permission
@Deprecated('Use canBeUsedInDm and requiresPermissions instead')
build() RawApiMap
Returns built response for api
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
registerHandler(SlashCommandHandler handler) → void
Registers handler for command. Note command cannot have handler if there are options present
setId(Snowflake id) → void
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited