updating to discord v13

This commit is contained in:
John Facey
2022-06-29 19:49:03 -05:00
parent 4a421391f6
commit 3d6747f72b
13 changed files with 812 additions and 189 deletions

25
commands/play.js Normal file
View File

@@ -0,0 +1,25 @@
var libTrivia = require("../libTrivia.js");
module.exports = {
name: 'play',
description: 'Play',
async execute(message, args) {
try {
let questions = libTrivia.getQuestions();
var i = Math.floor(Math.random() * (questions.length - 0) + 0);
message.reply(`**Question**: *${questions[i].question}*
**Select an Answer: **
**[!answer 1]**. *${questions[i].randomAnswers[0]}*
**[!answer 2]**. *${questions[i].randomAnswers[1]}*
**[!answer 3]**. *${questions[i].randomAnswers[2]}*
**[!answer 4]**. *${questions[i].randomAnswers[3]}*
`);
libTrivia.setCurrentQuestion(i);
} catch (err) {
message.reply(err.toString());
}
}
};