// mention user:
msg = "Write to <@USERID>";
// mention role:
msg = "Dont ping <@&ROLEID>";
// We are going to use regex because its the best way to check
// client -> your discord.js Client variable
if (message.content.match(/^<@!?${client.user.id}>( |)$/))
return message.channel.send("Hello! thanks for mentioning me!");