Reputation: 33
I have searched the discord.js documentation but I can't find a way to make the bot detect if their own messages were replied by a user in a discord server. Is there a way to do this?
Thank you so much, Paul10
Upvotes: 1
Views: 986
Reputation: 9041
All messages have a message_reference
property. This contains the guild, channel and message id. This property is null if it isn’t a reply. I assume you already know the channel.
//async function
//message is an instance of Message
let { channel, message_reference: reply } = message
const repliedTo = await channel.messages.fetch(reply.message_id);
//repliedTo is now the replied message with author, content, etc
Upvotes: 3