From 59673a1c9dc27d098c5216e1490a4b8acf0880a9 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 18 Jun 2019 00:02:15 +0200 Subject: [PATCH] case insensitive and only work with author --- commands/minigame/borgar.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/commands/minigame/borgar.js b/commands/minigame/borgar.js index dda4cc3b..05004d2c 100644 --- a/commands/minigame/borgar.js +++ b/commands/minigame/borgar.js @@ -46,21 +46,20 @@ class borgarCommand extends Command { message.channel.send(borgarEmbed); - const filter = m => m.content; - message.channel.awaitMessages(filter, { time: args.time, errors: ['time'] }) + const filter = m => m.content && m.author.id == message.author.id; + message.channel.awaitMessages(filter, {time: 10000, errors: ['time'] }) .catch(collected => { - console.log(collected.map(collected => collected.content)); let userIngredient = collected.map(collected => collected.content); console.log(hamIngredient + '\n' + userIngredient); - if (userIngredient.toString() == hamIngredient.toString()) { - return message.channel.send('u won bro,,,, that\'s kinda epic if i do say so myself'); + if (userIngredient.toString().toLowerCase() == hamIngredient.toString()) { + return message.reply('u won bro,,,, that\'s kinda epic if i do say so myself'); } else { if (userIngredient.length == hamIngredient.length) { - return message.channel.send(`you failed noob... you were supposed to make ${hamIngredient}`); + return message.reply(`you failed noob... you were supposed to make ${hamIngredient}`); } else if (userIngredient.length > hamIngredient.length) { - return message.channel.send('Too much ingredient...'); + return message.reply('Too much ingredient...'); } else { - return message.channel.send('time runned out noob...'); + return message.reply('time runned out noob...'); } } });