Beep beep

This commit is contained in:
Daniel Odendahl Jr
2017-10-08 18:59:52 +00:00
parent 3ed9f7a423
commit 6a9d24cf87
18 changed files with 150 additions and 116 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ module.exports = class AkinatorCommand extends Command {
answers.push('end');
await msg.say(stripIndents`
**${++data.step}.** ${data.question}
${data.answers.map(answer => answer.answer).join(' | ')} | End
${data.answers.map(answer => answer.answer).join(' | ')}
`);
const filter = res => res.author.id === msg.author.id && answers.includes(res.content.toLowerCase());
const msgs = await msg.channel.awaitMessages(filter, {
@@ -63,7 +63,7 @@ module.exports = class AkinatorCommand extends Command {
return msg.say(response === 'yes' ? 'Another win for me!' : 'Bravo, you have defeated me.');
} catch (err) {
this.sessions.delete(msg.channel.id);
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
throw err;
}
}