Discord Quiz
An NPM package to help create simple quizzes for Discord bots.
By SkyMocha.
NOTE: This package was originally built on v.11 and updated for v.12 so it may not work on versions beyond v.12 (my favorite version <3).If this doesn't fit your fancy, maybe try implementing a command to send Mastodon toots via Discord using tootcord. Consider supporting me by following me on Mastodon, YouTube (where I primarily do video-essays), TikTok or even supporting me on Patreon!
Installation
npm i discord-quiz
Usage
const Discord = require ('discord.js');
const dquiz = require ('discord-quiz');
const client = new Discord.Client();
dquiz.add_question('When was the war of 1812?', '1812', ['1800', '2020', '777']);
client.on ('message', (message) => {
if (message.content.toLowerCase().startsWith('!quiz'))
dquiz.quiz(message, 10, 'ffb7c5');
})
client.login (<your token>);
Documentation
void add_question(String question, String correct_answer, String[] false_answers)
void quiz(Discord Message
, Time in Seconds
, Hex Code
)
License
ISC