Command

export declare class Command<Client extends IgloClient = IgloClient> extends Base<Client> implements CommandOptions

Constructor

constructor(client: Client, options: CommandOptions): this;

Paramaters

nametypeoptionaldescription
clientClientNo-
optionsCommandOptionsNo-

Properties

category: string

The category of the command (automatically set by the commandHandler)

client: Client

The Discord client to interact with Discord

description: string

The default description of the command.

descriptions: Partial<Record<Locale, string>>

Localized version of description.

filename: string

The name of the file associated with the command

name: string

The name of the command

nameLocalizations: Partial<Record<Locale, string>>

The name localizations of the command

options: Array<ApplicationCommandOptionData>

Options users have to pass through before sending the command

default

[]

permissions: CommandPermissions

The permissions for the command

Methods

_autocomplete(interaction)

function _autocomplete(interaction: AutocompleteInteraction<CacheType>): Promise<void>

Paramaters

nametypeoptionaldescription
interactionAutocompleteInteraction<CacheType>No-

Description

_run(interaction)

function _run(interaction: CommandInteraction<CacheType>): Promise<void>

Paramaters

nametypeoptionaldescription
interactionCommandInteraction<CacheType>No-

Description

autocomplete(interaction)

function autocomplete(interaction: AutocompleteInteraction<CacheType>): Awaitable<void>

Paramaters

nametypeoptionaldescription
interactionAutocompleteInteraction<CacheType>No-

Description

load(options)

function load(options: CommandLoadOptions): void

Paramaters

nametypeoptionaldescription
optionsCommandLoadOptionsNo-

Description

Runs when the command is loaded

requires

super callback on overwrite

run(interaction)

function run(interaction: CommandInteraction<CacheType>): Awaitable<void>

Paramaters

nametypeoptionaldescription
interactionCommandInteraction<CacheType>No-

Description

unload()

function unload(): void

Description

Runs when the command is unloaded