1
0
Fork 0

case insensitive and only work with author

akairo
loicbersier 5 years ago
parent d95e00bef3
commit 59673a1c9d

@ -46,21 +46,20 @@ class borgarCommand extends Command {
message.channel.send(borgarEmbed); message.channel.send(borgarEmbed);
const filter = m => m.content; const filter = m => m.content && m.author.id == message.author.id;
message.channel.awaitMessages(filter, { time: args.time, errors: ['time'] }) message.channel.awaitMessages(filter, {time: 10000, errors: ['time'] })
.catch(collected => { .catch(collected => {
console.log(collected.map(collected => collected.content));
let userIngredient = collected.map(collected => collected.content); let userIngredient = collected.map(collected => collected.content);
console.log(hamIngredient + '\n' + userIngredient); console.log(hamIngredient + '\n' + userIngredient);
if (userIngredient.toString() == hamIngredient.toString()) { if (userIngredient.toString().toLowerCase() == hamIngredient.toString()) {
return message.channel.send('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.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) { } else if (userIngredient.length > hamIngredient.length) {
return message.channel.send('Too much ingredient...'); return message.reply('Too much ingredient...');
} else { } else {
return message.channel.send('time runned out noob...'); return message.reply('time runned out noob...');
} }
} }
}); });

Loading…
Cancel
Save