command() with a type: 'message' here.
src/commands/quote.ts
message is the message the menu was used on, whole, even when the bot never saw it before.
Everything a menu command declares is in the reference.
On a person
Withtype: 'user', the command shows up in the menu of a person: a right click on their name, in the member list or in a message.
src/commands/avatar.ts
target is the person, as a User. targetMember is that person as a member of the server, or null when they are not in it (any more).
What changes from a slash command
nameis what the menu shows: capitals and spaces are fine ('Show avatar'), 32 characters at most.- There is no
description, nooptionsand noautocomplete: the command receives what it was used on. Writing one is underlined in your editor. localesonly translates the name:locales: { fr: { name: 'Voir l’avatar' } }. Language files never describe a menu command: its texts stay in its file.- Everything else works the same:
where,permissions,cooldown,ephemeral,nsfw, and whatrunreceives about the place (guild,member,channel,interaction,t).
/quote and a Quote menu are two commands.
Without a type
type is what makes a menu command: left out, command() is a slash command, as everywhere else in this guide.
In development
Menu commands are registered on your test server with the slash commands, and updated when their file changes:Ctrl+R (Cmd+R on a Mac).
Testing
In a scenario,bot.use() uses a menu command on what you give in on: a message for a message menu, a person for a user menu.
src/commands/quote.test.ts
chapterjs test uses each menu command by itself: on an ordinary message or person, and on the hard ones (a message at its longest, the bot, the owner, someone who left). See Testing.
command() reference
Everything a menu command declares and receives.
Answering
Answer, privately or not, and take your time.