From 65def95ee0839a8cd5e3ea66bd46e2ed77a447b5 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Tue, 27 Oct 2020 12:07:39 -0600 Subject: [PATCH] Added prefix message when pinged --- events/message.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/events/message.js b/events/message.js index dd22d9b..772bdcb 100644 --- a/events/message.js +++ b/events/message.js @@ -6,7 +6,7 @@ const UserData = require('../models/user'); module.exports = async (client, message) => { if (message.author.bot) {return undefined;} - if (message.channel.type == 'dm') /*{var dmch = true;} else {var dmch = false};*/ {return undefined;} + if (message.channel.type === 'dm') /*{var dmch = true;} else {var dmch = false};*/ {return undefined;} if (message.channel.type !== 'text' && message.channel.type !== 'dm') {return undefined;} //if (message.channel.type == "text") {if (settings[message.guild.id]) {prefix = settings[message.guild.id].prefix;};}; @@ -24,6 +24,13 @@ module.exports = async (client, message) => { : message.content.slice(3 + client.user.id.length).trim().split(/\s+/g); var cmd = args.shift().toLowerCase().trim(); + if ([`<@${client.user.id}>`, `<@!${client.user.id}>`].includes(msg)) { + return message.channel.send(new Discord.MessageEmbed() + .setTitle(["Yep, that's me!", "^^ Hiya!", "Oh, hi there!", "Sure, what's up?", "How can I help!", "Natsuki is busy, but I can take a message for you!", "Teehee that's me!", "You were looking for Natsuki Tivastl, right?", "Sure! What's up?", "Pong!"][Math.floor(Math.random() * 10)]) + .setDescription("My prefix here is `" + prefix + "`. Use `" + prefix + "help` to see what commands you can use.") + .setColor('c375f0')); + } + if (mention && message.guild) {require('../util/mention')(message, msg, args, cmd, prefix, mention, client);} let tu = await UserData.findOne({uid: message.author.id}); if (tu && tu.statusmsg.length && tu.statusclearmode === 'auto') {