Reply to a message as bot

This is less a question of help and more of curiosity, In Discord JS I know you can reply to the interaction using "interaction.reply" instead of "interaction.channel.send" I got curious and have decided to ask, can you (using a message id gained from the slash command) reply to a specific message in the same channel? As an example, You have a command that just repeats a message given in a slash command (/say "message") Could you then create the same command, but with an extra option to input a message id which the bot would then use to reply to said message, (/say "message" "messageid") using something like "messageid.reply"? I tried to tinker around with it, but I don't know all the constraints of Discord JS and couldn't find a solution and google wasn't much help either. Sorry if this is a dumb question.
4 Replies
d.js toolkit
d.js toolkit7mo ago
- 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 OP
Syjalo
Syjalo7mo ago
Without fetching the message
await <Channel>.send({ content, reply: { messageReference: 'id' } });
await <Channel>.send({ content, reply: { messageReference: 'id' } });
d.js docs
d.js docs7mo ago
interface ReplyOptions Options for sending a message with a reply.
HarmlessBird
HarmlessBird7mo ago
Oh my god, Thank you so much XD I cant believe it was that easy and I missed it