diff --git a/README.md b/README.md index 6414473..c8a8fb2 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/commands/fun/trivia.js b/commands/fun/trivia.js index 7864186..560d910 100644 --- a/commands/fun/trivia.js +++ b/commands/fun/trivia.js @@ -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({