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