Skip to content

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.

T extends MenuType

T

Whether the item shows on a user or on a message.

MenuConfig

What Discord shows.

(c) => Response | Promise<Response>

Answers the click, with reply, defer and modal as in a slash command.

ContextMenu<T>

The context menu command, for the commands of bot.

const avatar = contextMenu('user', { name: 'Show avatar' }, (c) => c.reply(c.target.username));