Skip to content

Context

Context<O> = object & FollowUps

Defined in: utils/command.ts:25

What the handler of a slash command gets.

O extends Options

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.

() => Promise<string | object & MessageOptions>

boolean

Response

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.

Modal

string

Response

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.

string

ReplyOptions

Response