Skip to content

MessageCommandRun

Defined in: packages/discordjs/src/message-commands.ts:28

How a message command went.

command: string

Defined in: packages/discordjs/src/message-commands.ts:13

The command’s name as your bot defines it, after aliases are resolved (ban, not what was typed). 1–32 characters.

MessageCommandInfo.command


optional durationMs?: number

Defined in: packages/discordjs/src/message-commands.ts:30

How long the handler took, in milliseconds.


optional error?: unknown

Defined in: packages/discordjs/src/message-commands.ts:32

What the handler threw, if anything. Only its class name and Discord error code are recorded.


optional failed?: boolean

Defined in: packages/discordjs/src/message-commands.ts:34

The command failed, but your bot caught the error itself. Implied when error is set.


optional group?: string

Defined in: packages/discordjs/src/message-commands.ts:15

Subcommand group, if the command has one.

MessageCommandInfo.group


optional options?: readonly string[]

Defined in: packages/discordjs/src/message-commands.ts:19

Names of the arguments the user gave.

MessageCommandInfo.options


optional optionValues?: Readonly<Record<string, string | number | boolean>>

Defined in: packages/discordjs/src/message-commands.ts:24

Argument values. Only names listed in captureOptionValues are kept, never a value holding a Discord ID (pass a mentioned user or channel as an argument name, not a value); strings are cut to 100 characters.

MessageCommandInfo.optionValues


optional sub?: string

Defined in: packages/discordjs/src/message-commands.ts:17

Subcommand, if the command has one.

MessageCommandInfo.sub