From f95063274f7dcd4c992ca7406fade4ef5b9c2d69 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 24 Dec 2021 03:43:36 -0700 Subject: [PATCH] Update the next command (untested) --- src/commands/next.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/next.ts b/src/commands/next.ts index 2337b4f..db9e96a 100644 --- a/src/commands/next.ts +++ b/src/commands/next.ts @@ -4,7 +4,7 @@ import { commands, question_index, user_answers, - correct_answers, + questions, user_right_count, reset_users } from "../main"; @@ -19,12 +19,12 @@ function next_command(_: string[]) { // count users who got it right let users_correct = Object.values(user_answers) - .filter(x => x == correct_answers[question_index]) + .filter(x => x == questions[question_index]) .length; let correct_users: string[] = []; for (var user in user_answers) { - if (user_answers[user] == correct_answers[question_index]) { + if (user_answers[user] == questions[question_index]) { correct_users.push(user); if (user_right_count[user] == null) { user_right_count[user] = 1; @@ -47,7 +47,7 @@ ${correct_users.join(", ")} ) // Check if the quiz has hit the end - if (question_index == correct_answers.length - 1) { + if (question_index == questions.length - 1) { // Send message in Discord for record-keeping axios.post(