Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elitezen/discord-trivia
Easily implement trivia games with your Discord.JS
https://github.com/elitezen/discord-trivia
discord discord-js discord-js-v14 game javascript trivia trivia-game typescript
Last synced: 4 months ago
JSON representation
Easily implement trivia games with your Discord.JS
- Host: GitHub
- URL: https://github.com/elitezen/discord-trivia
- Owner: Elitezen
- License: mit
- Created: 2021-12-28T16:25:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T19:15:38.000Z (10 months ago)
- Last Synced: 2024-09-24T12:02:47.951Z (4 months ago)
- Topics: discord, discord-js, discord-js-v14, game, javascript, trivia, trivia-game, typescript
- Language: TypeScript
- Homepage: https://elitezen.github.io/discord-trivia-website/
- Size: 583 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![Discord Trivia Logo](https://i.imgur.com/9gqrPGC.png)
# Discord Trivia
A package that provides an easy way to create fully-fledged trivia games for Discord bots with Discord.JS. Includes support for +20 categories as well as customizable game settings, themes, and game messages. Comes with a built-in leaderboard system to track scores and rankings!
## CHANGELOG
### 3.0.2
- Additional bug fixes to answer checking.## Basic Example
```js
import { GameManager } from 'discord-trivia';const manager = new GameManager();
// -- Inside your command function --
const game = manager.createGame(interaction.channel);try {
await game.startQueue(interaction);
} catch (err) {
console.error(`An error occurred: ${err}`);
}
```## Custom Questions
```js
const customQuestions = [
new BooleanQuestion()
.setValue("discord-trivia is awesome!")
.setCategory("My epic category")
.setDifficulty('easy')
.setCorrectAnswer('true'),
new MultipleChoiceQuestion()
.setValue("What's the best pizza topping?")
.setCategory("food")
.setDifficulty('medium')
.setCorrectAnswer("Chicken feet")
.setIncorrectAnswers(["Pepperoni", "Sausage", "Olives"])// Add more custom questions here...
];game.config.customQuestions = customQuestions;
game.startQueue(interaction);
```## Full Guide
[Click here to view the full guide](https://elitezen.github.io/discord-trivia-website/)