updating to discord v13
This commit is contained in:
25
commands/play.js
Normal file
25
commands/play.js
Normal 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());
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user