Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Commit

Permalink
Merge branch 'v1.0.1-bugfixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
NatKarmios committed Apr 3, 2018
2 parents e84d6e4 + 1e649b0 commit cfcce2b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions app/_modules/db/dbQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ import type {
const CREATE_QUESTIONS_TABLE =
'CREATE TABLE IF NOT EXISTS Questions (' +
'questionID INTEGER PRIMARY KEY ASC, ' +
'content TEXT UNIQUE, ' +
'correctAnswer TEXT, ' +
'incorrectAnswers TEXT, ' +
'external BOOLEAN CHECK (external IN (0,1))' +
'content TEXT UNIQUE NOT NULL, ' +
'correctAnswer TEXT NOT NULL, ' +
'incorrectAnswers TEXT NOT NULL, ' +
'external BOOLEAN CHECK (external IN (0,1)) NOT NULL' +
');';
const CREATE_USED_QUESTIONS_TABLE =
'CREATE TABLE IF NOT EXISTS UsedQuestions (' +
'usedQuestionID INTEGER PRIMARY KEY ASC, ' +
'questionID INTEGER, ' +
'cancelled BOOLEAN CHECK (cancelled IN (0,1)), ' +
'finishTime INTEGER, ' +
'duration INTEGER, ' +
'prize INTEGER, ' +
'usedQuestionID INTEGER PRIMARY KEY ASC,' +
'questionID INTEGER NOT NULL,' +
'cancelled BOOLEAN CHECK (cancelled IN (0,1)) NOT NULL,' +
'finishTime INTEGER NOT NULL,' +
'duration INTEGER NOT NULL,' +
'prize INTEGER NOT NULL,' +
'FOREIGN KEY(questionID) REFERENCES Questions(questionID)' +
');';
const CREATE_WINNERS_TABLE =
'CREATE TABLE IF NOT EXISTS Winners (' +
'winnerID INTEGER PRIMARY KEY ASC, ' +
'name TEXT, ' +
'usedQuestionID INTEGER, ' +
'winnerID INTEGER PRIMARY KEY ASC,' +
'name TEXT NOT NULL,' +
'usedQuestionID INTEGER NOT NULL,' +
'FOREIGN KEY(usedQuestionID) REFERENCES UsedQuestions(usedQuestionID)' +
');';
const INSERT_QUESTION =
Expand Down
4 changes: 2 additions & 2 deletions app/_modules/twitch/msgData.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

// The RegEx pattern used to parse Twitch messages
const PATTERN = /^@badges=([a-z/\d,-]*);color=(#[\dA-F]{6}?);display-name=([A-Za-z\d_]+);.*:[a-z\d_]+![a-z\d_]+@[a-z\d_]+\.tmi\.twitch\.tv (PRIVMSG|WHISPER) #?[a-z\d_]+ :(.+)$/;
const PATTERN = /^@badges=([a-z/\d,-]*);color=(?:(#[\dA-F]{6}))?;display-name=([A-Za-z\d_]+);.*:[a-z\d_]+![a-z\d_]+@[a-z\d_]+\.tmi\.twitch\.tv (PRIVMSG|WHISPER) #?[a-z\d_]+ :(.+)$/;

// An array to store the usernames of know moderators
const mods: Array<string> = [];
Expand Down Expand Up @@ -100,7 +100,7 @@ export const parseMsg = (
raw: nick,
display: name
},
color: search[2],
color: search[2] !== null && search[2] !== undefined ? search[2] : '',
isMod: hasModBadge || mods.includes(name),
sendMessage,
sendWhisper,
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quizzical",
"productName": "Quizzical",
"version": "1.0.0",
"version": "1.0.1",
"description": "A trivia bot for Twitch.tv",
"main": "./main.prod.js",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quizzical",
"productName": "Quizzical",
"version": "1.0.0",
"version": "1.0.1",
"description": "A trivia bot for Twitch.tv",
"scripts": {
"build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",
Expand Down

0 comments on commit cfcce2b

Please sign in to comment.