CommandContext
Defined in: packages/core/src/commands.ts:188
What a command handler gets, whether it was run as /name or as !name.
Type Parameters
Section titled “Type Parameters”M extends OptionMap = OptionMap
Properties
Section titled “Properties”bot:
Client
Defined in: packages/core/src/commands.ts:189
channelId
Section titled “channelId”channelId:
string|undefined
Defined in: packages/core/src/commands.ts:195
guildId
Section titled “guildId”guildId:
string|undefined
Defined in: packages/core/src/commands.ts:194
interaction
Section titled “interaction”interaction:
CommandInteraction|undefined
Defined in: packages/core/src/commands.ts:201
The slash interaction, when source is "slash".
member
Section titled “member”member:
GuildMember|null
Defined in: packages/core/src/commands.ts:199
The person who ran it as a guild member, when it ran in a guild.
message
Section titled “message”message:
Message|undefined
Defined in: packages/core/src/commands.ts:203
The message, when source is "prefix".
options
Section titled “options”options:
OptionValues<M>
Defined in: packages/core/src/commands.ts:191
The command’s options, typed from its definition.
source
Section titled “source”source:
"slash"|"prefix"
Defined in: packages/core/src/commands.ts:193
How it was run.
userId
Section titled “userId”userId:
string
Defined in: packages/core/src/commands.ts:197
The id of whoever ran it.
Methods
Section titled “Methods”defer()
Section titled “defer()”defer(
options?):Promise<void>
Defined in: packages/core/src/commands.ts:211
Tells Discord the answer will take a while (slash commands only; a no-op for prefix commands).
Parameters
Section titled “Parameters”options?
Section titled “options?”ephemeral?
Section titled “ephemeral?”boolean
Returns
Section titled “Returns”Promise<void>
reply()
Section titled “reply()”reply(
content):Promise<void>
Defined in: packages/core/src/commands.ts:209
Answers the command: an interaction reply for a slash command (a first
reply, an edit after defer(), then follow-ups), a message reply for a
prefix command. ephemeral only means something for slash commands.
Parameters
Section titled “Parameters”content
Section titled “content”string | InteractionReplyOptions
Returns
Section titled “Returns”Promise<void>