Skip to content

types

Defined in: types.ts:34

Extended Discord.js Client that carries a Command collection.

Instantiated once in client.ts and shared across the entire application as a singleton.

  • Client

new TSClient(options): TSClient

Defined in: node_modules/discord.js/typings/index.d.ts:1029

ClientOptions

TSClient

Client.constructor

commands: Collection<string, Command>

Defined in: types.ts:36

Map of command name → Command object, populated at startup.

Defined in: types.ts:17

Contract that every slash command module must satisfy.

Each command file in commands/ exports an object conforming to this interface. The bot loader in index.ts registers commands that have at least data and execute.

data: SlashCommandBuilder

Defined in: types.ts:19

Slash command definition built with the discord.js SlashCommandBuilder.

optional autocomplete(interaction): Promise<void>

Defined in: types.ts:23

Handler invoked when Discord requests autocomplete suggestions for this command.

AutocompleteInteraction

Promise<void>

optional execute(interaction): Promise<void>

Defined in: types.ts:21

Handler invoked when a user runs the slash command.

CommandInteraction

Promise<void>

optional handleModal(interaction): Promise<void>

Defined in: types.ts:25

Handler invoked when a modal submitted by this command is received.

ModalSubmitInteraction

Promise<void>