From e52fbb74bb7f55c857fb82397188ff5303c1bf93 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 2 Dec 2021 16:35:03 -0600 Subject: [PATCH] Add check to make sure the quiz has started before recording votes. --- src/services/twitch_handler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/twitch_handler.ts b/src/services/twitch_handler.ts index e3ccaf0..f0b9be4 100644 --- a/src/services/twitch_handler.ts +++ b/src/services/twitch_handler.ts @@ -15,7 +15,7 @@ import { LOAD_CONFIG } from "../utils/Config"; import { PERM } from "../constants"; import * as tmi from "tmi.js"; -import { users } from "../main"; +import { question_index, users } from "../main"; export const run_twitch = (): void => { @@ -73,7 +73,7 @@ export const run_twitch = (): void => { // Check if the user is voting let match = message.match(/\((?[A-F])\i)/) - if (match) { + if (match && question_index != -1) { let choice: string = (match as any).choice; // Update the user's answer