-2

I was looking for a command that would give a question and 4 options ( if possible as buttons or reactions), where i could give questions in the code with the correct answer, but all i could find online were for slash commands, getting questions from a website or were v12 of discord.js.

I don't know much, so any help would be great.

1 Answers1

1

Checkout my library discord-trivia, used for integrating full trivia matches.

npm i discord-trivia

You can use either Messages or slash command interactions

// Namespace
const { TriviaManager } = require('discord-trivia');
const trivia = new TriviaManager();

// Function
const game = trivia.createGame(message); // or createGame(interaction)

game
   .start()
   .catch(console.error);

Check out the NPM page for a full walkthrough on customization

Elitezen
  • 6,551
  • 6
  • 15
  • 29
  • Thanks! This works great! But is there any way to add our own questions? Is it also possible to change the start and end embeds? – Sreyas Menon May 03 '22 at 13:35
  • The questions come from the [Open Trivia Database API](https://opentdb.com/), You can propose questions there. Currently the only aspect about an embed you can edit is it's color via `TriviaManagerOptions#theme`. I'll take these questions as feature requests for the future – Elitezen May 03 '22 at 13:46