contextMenu
contextMenu<
T>(menu,config,run):ContextMenu<T>
Defined in: context-menu.ts:24
Declares a context menu command: an item in the Apps menu when the user right-clicks a user or a
message. Add it to the commands of bot, next to the slash commands. It has no options
and no description. The handler gets the user or the message as c.target.
Type Parameters
Section titled “Type Parameters”T extends MenuType
Parameters
Section titled “Parameters”T
Whether the item shows on a user or on a message.
config
Section titled “config”What Discord shows.
(c) => Response | Promise<Response>
Answers the click, with reply, defer and modal as in a slash command.
Returns
Section titled “Returns”ContextMenu<T>
The context menu command, for the commands of bot.
Example
Section titled “Example”const avatar = contextMenu('user', { name: 'Show avatar' }, (c) => c.reply(c.target.username));