How do I make a Message Context Action
Currently I have:
I don't get any errors or warnings, but I feel like just building it doesn't actually register it with Discord. I'm not seeing the context action on any messages in the server the bot is in.
I'm following this guide:
https://discordjs.guide/interactions/context-menus.html#registering-context-menu-commands
I have this to handle it in my "interactionCreate" handler:
But I can't get the context action to even show up to test it. I feel like I'm missing something basic.
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
9 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPshow where you register your commands
thats how you handle them
not where you register them
you create a single command there
This is the only command I have thats successfully registered
which you also should not do on every start
yes because you actually register it
just defining the builder wont register it
:guide: Creating Your Bot: Registering slash commands
read more
:method: BaseInteraction#isContextMenuCommand()
@14.16.2
Indicates whether this interaction is a ContextMenuCommandInteractionyour typeguard also is wrong
Ohh isContextMenuCommand() right
I see now you just register it like a regular slash command
Thank you!!
It worked