trivia: add computers category

This commit is contained in:
Ayden Jahola 2024-09-06 00:13:07 +01:00
parent caf133207f
commit 06934db8b9
No known key found for this signature in database
GPG key ID: 71DD90AE4AE92742

View file

@ -21,7 +21,8 @@ module.exports = {
.setRequired(true) .setRequired(true)
.addChoices( .addChoices(
{ name: "Video Games", value: "15" }, { name: "Video Games", value: "15" },
{ name: "Anime & Manga", value: "31" } { name: "Anime & Manga", value: "31" },
{ name: "Computers", value: "18" }
) )
), ),
@ -46,7 +47,11 @@ module.exports = {
try { try {
const categoryId = interaction.options.getString("category"); const categoryId = interaction.options.getString("category");
const categoryName = const categoryName =
categoryId === "15" ? "Video Games" : "Anime & Manga"; categoryId === "15"
? "Video Games"
: categoryId === "31"
? "Anime & Manga"
: "Computers";
// Fetch a trivia question from the cache or the API // Fetch a trivia question from the cache or the API
let triviaQuestion = await TriviaQuestion.findOne({ let triviaQuestion = await TriviaQuestion.findOne({