mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-22 08:45:55 +00:00
trivia: add more categories
This commit is contained in:
parent
09438d2d21
commit
96a12f0f72
2 changed files with 29 additions and 8 deletions
|
@ -89,7 +89,7 @@ node bot.js
|
|||
|
||||
### Fun Commands
|
||||
|
||||
- **/trivia**: Starts a trivia game with video game-themed, Anime & Manga and Computers (more to come soon!) questions. Players have 30 seconds to answer.
|
||||
- **/trivia**: Starts a trivia game with video game-themed, Anime & Manga, Computers, Board Games, Comics, Cartoons & Animations, Film and General Knowledge (more to come soon!) questions. Players have 30 seconds to answer.
|
||||
|
||||
- Accepts both number answers (1-4) **or** the correct answer
|
||||
- for example:
|
||||
|
|
|
@ -20,9 +20,14 @@ module.exports = {
|
|||
.setDescription("Choose a trivia category")
|
||||
.setRequired(true)
|
||||
.addChoices(
|
||||
{ name: "General Knowledge", value: "9" },
|
||||
{ name: "Video Games", value: "15" },
|
||||
{ name: "Anime & Manga", value: "31" },
|
||||
{ name: "Computers", value: "18" }
|
||||
{ name: "Computers", value: "18" },
|
||||
{ name: "Board Games", value: "16" },
|
||||
{ name: "Comics", value: "29" },
|
||||
{ name: "Cartoons & Animations", value: "32" },
|
||||
{ name: "Film", value: "11" }
|
||||
)
|
||||
),
|
||||
|
||||
|
@ -46,12 +51,28 @@ module.exports = {
|
|||
|
||||
try {
|
||||
const categoryId = interaction.options.getString("category");
|
||||
const categoryName =
|
||||
categoryId === "15"
|
||||
? "Video Games"
|
||||
: categoryId === "31"
|
||||
? "Anime & Manga"
|
||||
: "Computers";
|
||||
const categoryName = (() => {
|
||||
switch (categoryId) {
|
||||
case "15":
|
||||
return "Video Games";
|
||||
case "31":
|
||||
return "Anime & Manga";
|
||||
case "18":
|
||||
return "Computers";
|
||||
case "16":
|
||||
return "Board Games";
|
||||
case "29":
|
||||
return "Comics";
|
||||
case "32":
|
||||
return "Cartoons & Animations";
|
||||
case "11":
|
||||
return "Film";
|
||||
case "9":
|
||||
return "General Knowledge";
|
||||
default:
|
||||
return "Video Games";
|
||||
}
|
||||
})();
|
||||
|
||||
// Fetch a trivia question from the cache or the API
|
||||
let triviaQuestion = await TriviaQuestion.findOne({
|
||||
|
|
Loading…
Reference in a new issue