Make it so the user can only vote one time for each question
This commit is contained in:
parent
e52fbb74bb
commit
fec987114f
1 changed files with 5 additions and 1 deletions
|
|
@ -73,7 +73,11 @@ 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 && 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;
|
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