trivia: include the correct answer if the user answers wrong or time's up

This commit is contained in:
Ayden Jahola 2024-09-07 11:27:07 +01:00
parent 3efa8eac1b
commit b33a4c02cc
No known key found for this signature in database
GPG key ID: 71DD90AE4AE92742

View file

@ -154,7 +154,7 @@ const handleAnswerCollection = async (
let resultMessage = let resultMessage =
userAnswer === correctAnswer userAnswer === correctAnswer
? "Correct!" ? "Correct!"
: "Incorrect! Better luck next time."; : `Incorrect! the correct answer is **${correctAnswer}.**`;
let userScore = await Leaderboard.findOne({ userId }); let userScore = await Leaderboard.findOne({ userId });
if (!userScore) { if (!userScore) {
@ -190,7 +190,7 @@ const handleAnswerCollection = async (
answerCollector.on("end", (collected, reason) => { answerCollector.on("end", (collected, reason) => {
if (reason === "time") { if (reason === "time") {
interaction.followUp( interaction.followUp(
`<@${userId}> Time's up! You didn't answer in time.` `<@${userId}> Time's up! the correct answer is **${correctAnswer}.**`
); );
ONGOING_TRIVIA.delete(userId); ONGOING_TRIVIA.delete(userId);
} }