diff --git a/src/services/twitch_handler.ts b/src/services/twitch_handler.ts index f0b9be4..fef6a3e 100644 --- a/src/services/twitch_handler.ts +++ b/src/services/twitch_handler.ts @@ -73,7 +73,11 @@ export const run_twitch = (): void => { // Check if the user is voting let match = message.match(/\((?[A-F])\i)/) - if (match && question_index != -1) { + if ( + match // choice found in message + && users[context.username] == null // user not voted yet + && question_index != -1 // quiz started + ) { let choice: string = (match as any).choice; // Update the user's answer