diff --git a/commands/admin/bye.js b/commands/admin/bye.js index 7e4c5bb..877ac5f 100644 --- a/commands/admin/bye.js +++ b/commands/admin/bye.js @@ -56,7 +56,7 @@ class byeCommand extends Command { message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) .then(async messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { const body = {guildID: message.guild.id, channelID: message.channel.id, message: args.message}; await leaveChannel.update(body, {where: {guildID: message.guild.id}}); return message.channel.send(`The leave message have been set with ${args.message}`); diff --git a/commands/admin/log.js b/commands/admin/log.js index dc4ff1d..03bfb9b 100644 --- a/commands/admin/log.js +++ b/commands/admin/log.js @@ -30,7 +30,7 @@ class logCommand extends Command { message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) .then(async messages => { let messageContent = messages.map(messages => messages.content.toLowerCase()); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { await LogStats.destroy({where: {guild: message.guild.id}}); return message.channel.send('Log channel has been disabled!'); } else { diff --git a/commands/admin/tag.js b/commands/admin/tag.js index 9366a30..c8ee621 100644 --- a/commands/admin/tag.js +++ b/commands/admin/tag.js @@ -49,7 +49,7 @@ class TagCommand extends Command { return message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) .then(async messages => { let messageContent = messages.map(messages => messages.content.toLowerCase()); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { Tag.destroy({where: {serverID: message.guild.id}}); return message.channel.send('Tags have been reset.'); } else { @@ -93,7 +93,7 @@ class TagCommand extends Command { message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) .then(async messages => { let messageContent = messages.map(messages => messages.content.toLowerCase()); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { const body = {trigger: args.trigger, response: args.response, ownerID: message.author.id, serverID: message.guild.id}; await Tag.update(body, {where: {trigger: args.trigger, serverID: message.guild.id}}); return message.channel.send(`tag have been set to ${args.trigger} : ${args.response}`); diff --git a/commands/admin/welcome.js b/commands/admin/welcome.js index 167ed81..aae9e52 100644 --- a/commands/admin/welcome.js +++ b/commands/admin/welcome.js @@ -55,7 +55,7 @@ class welcomeCommand extends Command { message.channel.awaitMessages(filter, {time: 5000, max: 1, errors: ['time'] }) .then(async messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { const body = {guildID: message.guild.id, channelID: message.channel.id, message: args.message}; await joinChannel.update(body, {where: {guildID: message.guild.id}}); return message.channel.send(`The join message have been set with ${args.message}`); diff --git a/commands/owner/addResponse.js b/commands/owner/addResponse.js index 32b76f2..2900159 100644 --- a/commands/owner/addResponse.js +++ b/commands/owner/addResponse.js @@ -53,7 +53,7 @@ class addResponseCommand extends Command { message.channel.awaitMessages(filter, {time: 5000 * 1000, max: 1, errors: ['time'] }) .then(messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { const body = {trigger: args.trigger, response: args.response, type: args.type}; autoResponse.update(body, {where: {trigger: args.trigger}}); return message.channel.send(`autoresponse have been set to ${args.trigger} : ${args.response} with type: ${args.type}`); diff --git a/commands/owner/blacklist.js b/commands/owner/blacklist.js index 0d55ff6..d1be3ab 100644 --- a/commands/owner/blacklist.js +++ b/commands/owner/blacklist.js @@ -32,16 +32,18 @@ class blacklistCommand extends Command { if (!blacklist) { const body = {userID: args.userID}; userBlacklist.create(body); - return message.channel.send(`The following user have been blacklisted: ${this.client.users.resolve(args.userID).tag} (${args.userID})`); + return message.channel.send(`The following ID have been blacklisted: ${args.userID}`); } else { message.channel.send('This user is already blacklisted, do you want to unblacklist him? y/n'); const filter = m => m.content && m.author.id === message.author.id; message.channel.awaitMessages(filter, {time: 5000 * 1000, max: 1, errors: ['time'] }) .then(messages => { + console.log(messages); let messageContent = messages.map(messages => messages.content); - if (messageContent === 'y' || messageContent === 'yes') { + console.log(messageContent); + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { userBlacklist.destroy({where: {userID:args.userID}}); - return message.channel.send(`The following user have been unblacklisted: ${this.client.users.resolve(args.userID).tag} (${args.userID})`); + return message.channel.send(`The following ID have been unblacklisted: ${args.userID}`); } }) .catch(err => { diff --git a/commands/owner/serverblacklist.js b/commands/owner/serverblacklist.js index 7d62c9f..0ac5be8 100644 --- a/commands/owner/serverblacklist.js +++ b/commands/owner/serverblacklist.js @@ -39,7 +39,7 @@ class serverBlacklistCommand extends Command { message.channel.awaitMessages(filter, {time: 5000 * 1000, max: 1, errors: ['time'] }) .then(messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { guildBlacklist.destroy({where: {guildID:args.guildID}}); return message.channel.send(`The guild with the following id have been unblacklisted: ${args.guildID}`); } diff --git a/commands/owner/twitterBlacklist.js b/commands/owner/twitterBlacklist.js index 83295ab..ab8e42d 100644 --- a/commands/owner/twitterBlacklist.js +++ b/commands/owner/twitterBlacklist.js @@ -48,7 +48,7 @@ class TwitterBlacklistCommand extends Command { message.channel.awaitMessages(filter, {time: 5000 * 1000, max: 1, errors: ['time'] }) .then(messages => { let messageContent = messages.map(messages => messages.content); - if (messageContent == 'y' || messageContent == 'yes') { + if (messageContent[0] === 'y' || messageContent[0] === 'yes') { TwitterBlacklist.destroy({where: {userID:args.userID}}); return message.channel.send(`The user with the following id have been unblacklisted: ${args.userID}`); }