Answer on quoted message for slash commands
Hey,
I’m working on a bot using Discord.js and I’d like a Slash Command reply to the message that the user is referencing (the quoted message).
Use Case:
A user replies to a message in the chat.
They use the Slash Command in their reply.
The bot should not reply to the Slash Command message itself but instead to the original message the user replied to.
What I’ve tried:
I attempted to use interaction.message.reference.messageId, but it seems this only works with regular messages and not Slash Commands.
Is there any way to get the referenced message in a Slash Command? Or is this only possible with Message Commands?
Node: v20
djs: 14.15.2
6 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!now the bot should answer d.js.toolkit with the slash command

Thanks in advance 🙂
You cant. Use a message context menu
alright, thanks
so you want the bot to reply with the application's name?
oh