I am creating a command that "kills" people. I want the bot to return the message "Ha! You thought! @Author died!" if they ping the bot. (How do I get the Bot to see if it is pinged?) Answer has been updated and now fully works.
const Discord = require('discord.js');
const bot = new Discord.Client();
module.exports = {
name: 'kill',
description: 'kills',
execute(message, args, bot) {
message.delete({ timeout: 30000 });
if (message.content.startsWith('-kill')) {
const target = message.mentions.users.first();
const memberTarget = message.guild.members.cache.get(target.id);
if (message.mentions.has(bot.user)) {
return message.channel.send(`HA! SIKE! <@${message.author.id}> died.`);
}
message.channel.send(`<@${memberTarget.user.id}> has died!`);
console.log(`<@${memberTarget.user.id} died.`);
}
},
};

