Discord bot client.user.tag not working


This is my code right now:
    if (message.content.includes(client.user.tag)) {
            message.channel.send('Text here')
      console.log(message.author.tag + " just tagged me").catch(console.error)

But when I tag my bot it doesn’t work. What’s going on?


Can you send me your whole file so I can identify the problem? (Message me) Also, remember to remove your token when showing your bot’s code.


Hey, client.user.tag is the user tag, example: something#1234. So when you mention the bot it does not trigger. You can use this:
if(message.isMentioned(client.user)){ // your code here }

This triggers whenever your bot gets mentioned in a channel it can read. You do have to add this to your message event.