1.0.6 • Published 1 year ago

discord-quiz v1.0.6

Weekly downloads
39
License
ISC
Repository
github
Last release
1 year ago

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();

// Adds a question to the pool of available questions
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'); // Runs the quiz command
}) 

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

1.0.6

1 year ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago