types
Classes
Section titled “Classes”TSClient
Section titled “TSClient”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.
Extends
Section titled “Extends”Client
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TSClient(
options):TSClient
Defined in: node_modules/discord.js/typings/index.d.ts:1029
Parameters
Section titled “Parameters”options
Section titled “options”ClientOptions
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Client.constructor
Properties
Section titled “Properties”commands
Section titled “commands”commands:
Collection<string,Command>
Defined in: types.ts:36
Map of command name → Command object, populated at startup.
Interfaces
Section titled “Interfaces”Command
Section titled “Command”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.
Properties
Section titled “Properties”data:
SlashCommandBuilder
Defined in: types.ts:19
Slash command definition built with the discord.js SlashCommandBuilder.
Methods
Section titled “Methods”autocomplete()?
Section titled “autocomplete()?”
optionalautocomplete(interaction):Promise<void>
Defined in: types.ts:23
Handler invoked when Discord requests autocomplete suggestions for this command.
Parameters
Section titled “Parameters”interaction
Section titled “interaction”AutocompleteInteraction
Returns
Section titled “Returns”Promise<void>
execute()?
Section titled “execute()?”
optionalexecute(interaction):Promise<void>
Defined in: types.ts:21
Handler invoked when a user runs the slash command.
Parameters
Section titled “Parameters”interaction
Section titled “interaction”CommandInteraction
Returns
Section titled “Returns”Promise<void>
handleModal()?
Section titled “handleModal()?”
optionalhandleModal(interaction):Promise<void>
Defined in: types.ts:25
Handler invoked when a modal submitted by this command is received.
Parameters
Section titled “Parameters”interaction
Section titled “interaction”ModalSubmitInteraction
Returns
Section titled “Returns”Promise<void>