How do I make my bot react to someone else’s message if they are mentioned?

Hello, I’ve been trying to make my bot react to someone else’s message if they are mentioned, but I can’t find my way around it. Can someone tell me the method on how to make this?

Put this in your messageCreate event.

if(message.content.contains(`<@!${client.user.id}>`) || message.content.contains(`<@${client.user.id}>`)) {
    message.react("smile");
}

edit: oops, didnt know this was 1 month old, sorry,

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.