mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-22 16:55:55 +00:00
trivia: maybe true and false wont act up now? idk im dumb somtimes
This commit is contained in:
parent
06934db8b9
commit
4572fb18ed
1 changed files with 11 additions and 1 deletions
|
@ -96,7 +96,17 @@ module.exports = {
|
||||||
|
|
||||||
// Handle True/False questions specifically
|
// Handle True/False questions specifically
|
||||||
if (triviaQuestion.type === "boolean") {
|
if (triviaQuestion.type === "boolean") {
|
||||||
allAnswers = ["True", "False"];
|
// Always keep "True" as option 1 and "False" as option 2
|
||||||
|
answerMap = { 1: "True", 2: "False" };
|
||||||
|
} else {
|
||||||
|
// Shuffle answers for other types of questions
|
||||||
|
allAnswers = allAnswers.sort(() => Math.random() - 0.5);
|
||||||
|
|
||||||
|
// Create a mapping of numbers to answers
|
||||||
|
answerMap = allAnswers.reduce((map, answer, index) => {
|
||||||
|
map[index + 1] = answer;
|
||||||
|
return map;
|
||||||
|
}, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
allAnswers = allAnswers.sort(() => Math.random() - 0.5); // Shuffle answers
|
allAnswers = allAnswers.sort(() => Math.random() - 0.5); // Shuffle answers
|
||||||
|
|
Loading…
Reference in a new issue