From 663ba0b38f66010d2832ec97bb304f4991836af8 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 24 Oct 2020 16:40:12 +1100 Subject: [PATCH] fix blocklist --- bot/commands/Configuration/blocklist.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bot/commands/Configuration/blocklist.js b/bot/commands/Configuration/blocklist.js index e841cdd..49874a5 100644 --- a/bot/commands/Configuration/blocklist.js +++ b/bot/commands/Configuration/blocklist.js @@ -25,13 +25,11 @@ module.exports = class { list.push(`${user.username}#${user.discriminator}`); } - let description = 'The server blocklist is currently empty. Use `blocklist add ` to add people to the blocklist!'; - - if (list.length > 0) description = '```' + list.join(', ') + '```'; + if (list.length === 0) return message.channel.createMessage('The server blocklist is currently empty. Use `blocklist add ` to add people to the blocklist!'); const embed = new Embed() .setTitle('Users on blocklist: ' + data.guild.blocklist.length) - .setDescription(description) + .setDescription('```' + list.join(', ') + '```') .setColor('PINK'); message.channel.createMessage({ embed: embed }); @@ -39,7 +37,7 @@ module.exports = class { return; } - if (user.length === 0) return message.channel.createMessage( + if (!user) return message.channel.createMessage( `${client.constants.emojis.userError} You didn't specify a user. Usage: \`${this.help.usage}\`` ); @@ -51,10 +49,10 @@ module.exports = class { `${client.constants.emojis.userError} Found more than one user, try refining your search or pinging the user instead.` ); - member = message.channel.guild.members.get(member.id); - action = action.toLowerCase(); + member = member[0]; + const blocklist = data.guild.blocklist; if (action === 'add') {