forked from Supositware/Haha-Yes
Merge branch 'master' of https://gitlab.com/loicbersier/discordbot
This commit is contained in:
commit
9528e034cb
1 changed files with 26 additions and 18 deletions
|
@ -39,32 +39,40 @@ class borgarCommand extends Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const borgarEmbed = new MessageEmbed()
|
let borgarEmbed = new MessageEmbed()
|
||||||
.setTitle('hamborger delivery')
|
.setTitle('hamborger delivery')
|
||||||
.setDescription(`could you do me an **amborgar** that contain **${hamIngredient}**`)
|
.setDescription(`could you do me an **amborgar** that contain **${hamIngredient}**`)
|
||||||
.setFooter(`Level 0 | you have ${args.time} seconds to make that hamborgor`)
|
.setFooter(`Level 0 | you have ${args.time} seconds to make that hamborgor`)
|
||||||
.setTimestamp();
|
.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;
|
const filter = m => m.content && m.author.id == message.author.id;
|
||||||
message.channel.awaitMessages(filter, {time: args.time * 1000, errors: ['time'] })
|
message.channel.awaitMessages(filter, {time: args.time * 1000, max: hamIngredient.length, errors: ['time'] })
|
||||||
.catch(collected => {
|
.then(messages => {
|
||||||
let userIngredient = collected.map(collected => collected.content);
|
let userIngredient = messages.map(messages => messages.content);
|
||||||
|
|
||||||
if (userIngredient.toString().toLowerCase() == hamIngredient.toString()) {
|
if (userIngredient.toString().toLowerCase() == hamIngredient.toString()) {
|
||||||
return message.reply('u won bro,,,, that\'s kinda epic if i do say so myself');
|
return message.reply('u won bro,,,, that\'s kinda epic if i do say so myself');
|
||||||
} else {
|
} else if (userIngredient.length == hamIngredient.length) {
|
||||||
if (userIngredient.length == hamIngredient.length) {
|
return message.reply(`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) {
|
||||||
} else if (userIngredient.length > hamIngredient.length) {
|
return message.reply('Too much ingredient...');
|
||||||
return message.reply('Too much ingredient...');
|
}
|
||||||
} else {
|
})
|
||||||
return message.reply('time runned out noob...');
|
.catch(() => {
|
||||||
}
|
return message.reply('time runned out noob...');
|
||||||
}
|
});
|
||||||
|
}, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue