mirror of
				https://github.com/aydenjahola/discord-multipurpose-bot.git
				synced 2025-11-04 00:01:41 +00:00 
			
		
		
		
	trivia: include the correct answer if the user answers wrong or time's up
This commit is contained in:
		
							parent
							
								
									3efa8eac1b
								
							
						
					
					
						commit
						b33a4c02cc
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -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);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue