mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix Quiz
This commit is contained in:
@@ -29,16 +29,16 @@ module.exports = class QuizCommand extends commando.Command {
|
||||
.then(function(response) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('You have **fifteen** seconds to answer this question:')
|
||||
.setDescription(`**Category: ${response.body.category}**\n${response.body.question}`);
|
||||
.setDescription(`**Category: ${response.body[0].category}**\n${response.body[0].question}`);
|
||||
message.channel.sendEmbed(embed).then(() => {
|
||||
message.channel.awaitMessages(res => res.content.toLowerCase() === response.body.answer.toLowerCase() && res.author.id === message.author.id, {
|
||||
message.channel.awaitMessages(res => res.content.toLowerCase() === response.body[0].answer.toLowerCase() && res.author.id === message.author.id, {
|
||||
max: 1,
|
||||
time: 15000,
|
||||
errors: ['time'],
|
||||
}).then((collected) => {
|
||||
return message.channel.send(`Good Job! You won!`);
|
||||
}).catch(() => {
|
||||
return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body.answer}`);
|
||||
return message.channel.send(`Aw... Too bad, try again next time!\nThe Correct Answer was: ${response.body[0].answer}`);
|
||||
});
|
||||
}).catch(function(err) {
|
||||
console.log(err);
|
||||
|
||||
Reference in New Issue
Block a user