From 45ee8c5dc3d6c34fc2fba03183116210b44c6ad0 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Wed, 13 Nov 2019 22:35:59 +0100 Subject: [PATCH] Show the correct message when removing comment --- commands/owner/addDonator.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/owner/addDonator.js b/commands/owner/addDonator.js index 6078456..f7a288e 100644 --- a/commands/owner/addDonator.js +++ b/commands/owner/addDonator.js @@ -35,8 +35,8 @@ class addDonatorCommand extends Command { let userComment = ''; if (args.userComment) { userComment = args.userComment; - } else if (args.userComment == '') { - userComment = null; + } else if (!args.userComment) { + userComment = ''; } const Donator = await donator.findOne({where: {userID: args.id}}); @@ -53,10 +53,12 @@ class addDonatorCommand extends Command { if (messageContent == 'y' || messageContent == 'yes') { const body = {comment: userComment}; donator.update(body, {where: {userID: args.id}}); - if (userComment == null) { + console.log(userComment); + if (userComment == '') { return message.channel.send(`Removed the comment from ${this.client.users.get(args.id).username}#${this.client.users.get(args.id).discriminator} (${args.id})`); + } else { + return message.channel.send(`You edited the comment for ${this.client.users.get(args.id).username}#${this.client.users.get(args.id).discriminator} (${args.id}) with ${args.userComment}`); } - return message.channel.send(`You edited the comment for ${this.client.users.get(args.id).username}#${this.client.users.get(args.id).discriminator} (${args.id}) with ${args.userComment}`); } }) .catch(() => {