I am using Discord.js v13
My goal is in a message event, like this:
client.on('messageCreate', async message => {
//Code comes here
})
to check if anyone, no matter who, is replying to any message from a specific person
Using the reference field, you can get whether the message is a reply.
For example
client.on('messageCreate', async message => {
if (message.reference.messageId) { // the message is a reply to another message
let referenceMessage = message.channel.messages.cache.get(message.reference.messageId);
if (referenceMessage.author.id == MY_USER_SNOWFLAKE) {
// The reply was to the specific user!
}
}
})
Keep in mind that the reference message must be cached. If it isn't cached, you can use message.fetchReference().