Context
Context<
O> =object&FollowUps
Defined in: utils/command.ts:25
What the handler of a slash command gets.
Type Parameters
Section titled “Type Parameters”O extends Options
Type Declaration
Section titled “Type Declaration”defer: (
work,options?) =>Response
Shows “thinking…” now, then edits the answer to what work returns: the text, or
{ content, buttons, embeds }. Use it for work that takes longer than 3 seconds.
Parameters
Section titled “Parameters”() => Promise<string | object & MessageOptions>
options?
Section titled “options?”ephemeral?
Section titled “ephemeral?”boolean
Returns
Section titled “Returns”Response
interaction
Section titled “interaction”interaction:
APIChatInputApplicationCommandInteraction
The interaction as Discord sent it.
modal: (
modal,value?) =>Response
Opens a modal made with modal(). value comes back to its handler as c.value.
Parameters
Section titled “Parameters”value?
Section titled “value?”string
Returns
Section titled “Returns”Response
options
Section titled “options”options: { [K in keyof O]: O[K] extends Option<keyof OptionValue, infer R, infer V> ? R extends true ? V : V | undefined : never }
The option values, keyed by name. An option that is not required can be undefined.
reply: (
content,options?) =>Response
Answers within 3 seconds. Return what it gives.
Parameters
Section titled “Parameters”content
Section titled “content”string
options?
Section titled “options?”Returns
Section titled “Returns”Response