Add check to make sure the quiz has started before recording votes.

This commit is contained in:
Oliver-Akins 2021-12-02 16:35:03 -06:00
parent ebe49c2988
commit e52fbb74bb

View file

@ -15,7 +15,7 @@ import { LOAD_CONFIG } from "../utils/Config";
import { PERM } from "../constants"; import { PERM } from "../constants";
import * as tmi from "tmi.js"; import * as tmi from "tmi.js";
import { users } from "../main"; import { question_index, users } from "../main";
export const run_twitch = (): void => { export const run_twitch = (): void => {
@ -73,7 +73,7 @@ export const run_twitch = (): void => {
// Check if the user is voting // Check if the user is voting
let match = message.match(/\((?<choice>[A-F])\i)/) let match = message.match(/\((?<choice>[A-F])\i)/)
if (match) { if (match && question_index != -1) {
let choice: string = (match as any).choice; let choice: string = (match as any).choice;
// Update the user's answer // Update the user's answer