From 334fc093bab0e347ca73556278854087f3e9427d Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 8 Oct 2018 23:27:41 +0200 Subject: [PATCH] Fixed command --- commands/fun/despacito.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/fun/despacito.js b/commands/fun/despacito.js index 1b723fcf..05ce15de 100644 --- a/commands/fun/despacito.js +++ b/commands/fun/despacito.js @@ -22,11 +22,12 @@ module.exports = class DespacitoCommand extends Command { if (!user) { const number = Object.keys(responseObject).length; const despacitoNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; - message.channel.send({files: [responseObject[despacitoNumber]]}); + if (!user) + return message.channel.send({files: [responseObject[despacitoNumber]]}); } else if (user.id === message.author.id) { - message.say(`Did you just try to despacitoad yourself?`); + return message.say(`Did you just try to despacitoad yourself?`); } else if (user.id === this.client.user.id) { - message.say('Nice try but you wont get me :^)'); + return message.say('Nice try but you wont get me :^)'); } else message.delete(); message.say(`${user}, you have been despacitoad`);