Skip to content

Class: Command

Constructors

constructor

new Command(options)

Creates a new command

Parameters

Name Type Description
options CommandOptions Options for this command

Properties

data

data: ApplicationCommandData

The data sent to discord when registering this command


name

name: string

The name of this command


function

function: (interaction: BaseCommandInteraction<"cached">) => any

Type declaration

▸ (interaction): any

CommandOptions.run

Parameters
Name Type
interaction BaseCommandInteraction<"cached">
Returns

any


flags

flags: CommandFlags

This command's flags


permissions

permissions: CommandPermissions

The permissions required to invoke or execute this command

Methods

run

run(interaction): Promise<any>

Runs this command

Parameters

Name Type Description
interaction BaseCommandInteraction<"cached"> The interaction that triggered this command

Returns

Promise<any>

The return value of Command.function

Back to top