So I've got a bot and if it gets pinged in a message I want it to "die." I found an answer on here and tried it and it does not work. I was wondering if there has been a change.
client.on("messageCreate", async message => {
if(message.mentions.has(but.user)) {
message.reply("The bot will now die. Have a nice day!")
client.destroy();
}
})
Use the client's id to check the mention Collection
if (message.mentions.users.has(client.user.id)) {
}