ApplicationCommand class

Application Command structure

Application commands are commands that an application can register to Discord

NOTE: Not all of these fields are nullable in the API, but they have been left nullable for convenience with creating commands

https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure

Annotations
  • @JsonSerializable(includeIfNull: false)

Constructors

ApplicationCommand({String? id, ApplicationCommandType? type, String? applicationId, String? guildId, required String name, String? description, List<ApplicationCommandOption>? options, bool? defaultPermission, String? version})
Constructor
ApplicationCommand.fromJson(Map<String, dynamic> json)
From json
factory

Properties

applicationId String?
unique id of the parent application
final
defaultPermission bool?
whether the command is enabled by default when the app is added to a guild
final
description String?
1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands
final
guildId String?
guild id of the command, if not global
final
hashCode int
The hash code for this object.
no setterinherited
id String?
unique id of the command
final
name String
1-32 character name
final
options List<ApplicationCommandOption>?
the parameters for the command, max 25
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type ApplicationCommandType?
the type of command, defaults ApplicationCommandType.chatInput if not set
final
version String?
autoincrementing version identifier updated during substantial record changes
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
To json
toString() String
A string representation of this object.
inherited

Operators

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