Get message text from ContextMenuCommandInteraction

Another noob question, sorry! Pretty much title. I have tried parsing the JSON object and using fetchReply() but I believe that is for the reply generated by the bot.
Solution:
See if there's anything for MessageContextMenuInteraction
Jump to solution
7 Replies
KB
KB•12mo ago
If I remember correctly, you get it like so:
const message = interaction.options.getMessage('message', true);
const message = interaction.options.getMessage('message', true);
The true just means its required (ie can't be null)
Favna
Favna•12mo ago
Much easier actually https://github.com/favware/dragonite/blob/main/src/commands/Pokemon/pokemon.ts#L61 interaction.targetMessage.content Also this is one of the exception cases where you do not need the message content intent to get the message content. @Dragonite does not have that intent but the command still works. No options on context menu commands 🙂
KB
KB•12mo ago
Works for me. Never realized there was a type guard for that though, neat.
Songbird
SongbirdOP•12mo ago
Lioness100
Lioness100•12mo ago
You might need a separate type because it's a MessageContextMenu, not a UserContextMenu
Solution
Lioness100
Lioness100•12mo ago
See if there's anything for MessageContextMenuInteraction
Songbird
SongbirdOP•12mo ago
perfect. Thank you!!
Want results from more Discord servers?
Add your server