From 5b9d1873662e3d92ad89b2f0a8fc2b91a2c3bcbf Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 11 Jul 2019 22:09:49 +0200 Subject: [PATCH 1/3] made it a little bit more chalenging --- commands/minigame/borgar.js | 47 ++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/commands/minigame/borgar.js b/commands/minigame/borgar.js index ca05dfd..bcaaed9 100644 --- a/commands/minigame/borgar.js +++ b/commands/minigame/borgar.js @@ -39,32 +39,41 @@ class borgarCommand extends Command { } - const borgarEmbed = new MessageEmbed() + let borgarEmbed = new MessageEmbed() .setTitle('hamborger delivery') .setDescription(`could you do me an **amborgar** that contain **${hamIngredient}**`) .setFooter(`Level 0 | you have ${args.time} seconds to make that hamborgor`) .setTimestamp(); - message.channel.send(borgarEmbed); + message.util.send(borgarEmbed) + .then(() => { + setTimeout(async () => { + borgarEmbed = new MessageEmbed() + .setTitle('hamborger delivery') + .setDescription('You have to put each ingredients in seperate message!') + .setFooter(`Level 0 | you have ${args.time} seconds to make that hamborgor`) + .setTimestamp(); + message.util.edit(borgarEmbed); - const filter = m => m.content && m.author.id == message.author.id; - message.channel.awaitMessages(filter, {time: args.time * 1000, errors: ['time'] }) - .catch(collected => { - let userIngredient = collected.map(collected => collected.content); - - 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.reply(`you failed noob... you were supposed to make ${hamIngredient}`); - } else if (userIngredient.length > hamIngredient.length) { - return message.reply('Too much ingredient...'); - } else { - return message.reply('time runned out noob...'); - } - } + const filter = m => m.content && m.author.id == message.author.id; + message.channel.awaitMessages(filter, {time: args.time * 1000, errors: ['time'] }) + .catch(collected => { + let userIngredient = collected.map(collected => collected.content); + + 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.reply(`you failed noob... you were supposed to make ${hamIngredient}`); + } else if (userIngredient.length > hamIngredient.length) { + return message.reply('Too much ingredient...'); + } else { + return message.reply('time runned out noob...'); + } + } + }); + }, 2000); }); - } } From 0f65b56dccf28b2b90203430f6eb89582e756ec6 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 11 Jul 2019 23:07:38 +0200 Subject: [PATCH 2/3] made it a bit better --- commands/minigame/borgar.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/commands/minigame/borgar.js b/commands/minigame/borgar.js index bcaaed9..3d9abb5 100644 --- a/commands/minigame/borgar.js +++ b/commands/minigame/borgar.js @@ -56,21 +56,20 @@ class borgarCommand extends Command { message.util.edit(borgarEmbed); const filter = m => m.content && m.author.id == message.author.id; - message.channel.awaitMessages(filter, {time: args.time * 1000, errors: ['time'] }) - .catch(collected => { - let userIngredient = collected.map(collected => collected.content); - + message.channel.awaitMessages(filter, {time: args.time * 1000, max: hamIngredient.length, errors: ['time'] }) + .then(messages => { + let userIngredient = messages.map(messages => messages.content); + 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.reply(`you failed noob... you were supposed to make ${hamIngredient}`); - } else if (userIngredient.length > hamIngredient.length) { - return message.reply('Too much ingredient...'); - } else { - return message.reply('time runned out noob...'); - } + } else if (userIngredient.length == hamIngredient.length) { + return message.reply(`you failed noob... you were supposed to make **${hamIngredient}**`); + } else if (userIngredient.length > hamIngredient.length) { + return message.reply('Too much ingredient...'); } + }) + .catch(() => { + return message.reply('time runned out noob...'); }); }, 2000); }); From c72ad77b6e6950630271666036c5fed707c40f5b Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 11 Jul 2019 23:17:58 +0200 Subject: [PATCH 3/3] 2 seconds is apparently too fast --- commands/minigame/borgar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/minigame/borgar.js b/commands/minigame/borgar.js index 3d9abb5..b9579e3 100644 --- a/commands/minigame/borgar.js +++ b/commands/minigame/borgar.js @@ -71,7 +71,7 @@ class borgarCommand extends Command { .catch(() => { return message.reply('time runned out noob...'); }); - }, 2000); + }, 3000); }); } }