Add check to make sure the quiz has started before recording votes.
This commit is contained in:
parent
ebe49c2988
commit
e52fbb74bb
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue