From 0949ab74691ca1c9b29f095969b5a155480e568d Mon Sep 17 00:00:00 2001 From: litruv Date: Tue, 11 Jun 2019 03:17:46 +1000 Subject: [PATCH] fixed ambiguousness --- commands/insult.js | 4 ++-- index.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/insult.js b/commands/insult.js index a75a06b..e7d758a 100644 --- a/commands/insult.js +++ b/commands/insult.js @@ -6,8 +6,8 @@ module.exports = { permissions: ['READ_MESSAGES'], category: 'general', command: (client, msg) => { - if (msg.mentions.members.array().length > 0) - msg.channel.send(msg.mentions.members.first() + ', ' + getInsult()); + if (msg.mentions.members.filter(member => { member.id != client.user.id }).array().length > 0) + msg.channel.send(msg.mentions.members.filter(member => { member.id != client.user.id }).first() + ', ' + getInsult()); else msg.reply(getInsult()); } diff --git a/index.js b/index.js index 903f34f..9934ac4 100644 --- a/index.js +++ b/index.js @@ -163,6 +163,7 @@ function doCommand(msg, prefix) { else { var command = message.replace("@" + msg.guild.me.displayName, "").trim().split(" ", 1)[0]; msg.suffix = message.replace("@" + msg.guild.me.displayName, "").replace(command, "").trim() + //msg.mentions.users = msg.mentions.users.filter(mention => mention.id != client.user.id); }