Compare commits
2 Commits
0870ac9352
...
2ddac57365
Author | SHA1 | Date |
---|---|---|
|
2ddac57365 | |
|
a5fb878192 |
|
@ -1,17 +1,18 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.5.7",
|
"version": "1.5.8",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.5.7",
|
"version": "1.5.8",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
"bottleneck": "^2.19.5",
|
"bottleneck": "^2.19.5",
|
||||||
"config": "^3.3.6",
|
"config": "^3.3.6",
|
||||||
|
"html-entities": "^2.3.2",
|
||||||
"jsdom": "^18.1.0",
|
"jsdom": "^18.1.0",
|
||||||
"linkify-it": "^3.0.3",
|
"linkify-it": "^3.0.3",
|
||||||
"simple-node-logger": "^21.8.12",
|
"simple-node-logger": "^21.8.12",
|
||||||
|
@ -1906,6 +1907,11 @@
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/html-entities": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ=="
|
||||||
|
},
|
||||||
"node_modules/http-proxy-agent": {
|
"node_modules/http-proxy-agent": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
|
||||||
|
@ -5159,6 +5165,11 @@
|
||||||
"whatwg-encoding": "^2.0.0"
|
"whatwg-encoding": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"html-entities": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ=="
|
||||||
|
},
|
||||||
"http-proxy-agent": {
|
"http-proxy-agent": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "schat2-clive",
|
"name": "schat2-clive",
|
||||||
"version": "1.5.7",
|
"version": "1.5.8",
|
||||||
"description": "Game host for SChat 2-powered chat sites",
|
"description": "Game host for SChat 2-powered chat sites",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -21,6 +21,7 @@
|
||||||
"bhttp": "^1.2.8",
|
"bhttp": "^1.2.8",
|
||||||
"bottleneck": "^2.19.5",
|
"bottleneck": "^2.19.5",
|
||||||
"config": "^3.3.6",
|
"config": "^3.3.6",
|
||||||
|
"html-entities": "^2.3.2",
|
||||||
"jsdom": "^18.1.0",
|
"jsdom": "^18.1.0",
|
||||||
"linkify-it": "^3.0.3",
|
"linkify-it": "^3.0.3",
|
||||||
"simple-node-logger": "^21.8.12",
|
"simple-node-logger": "^21.8.12",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const timers = require('timers/promises');
|
const timers = require('timers/promises');
|
||||||
|
const { decode } = require('html-entities');
|
||||||
|
|
||||||
const questions = require('../../assets/jeopardy.json');
|
const questions = require('../../assets/jeopardy.json');
|
||||||
const shuffle = require('../utils/shuffle');
|
const shuffle = require('../utils/shuffle');
|
||||||
|
@ -171,7 +172,7 @@ async function onMessage(message, context) {
|
||||||
|
|
||||||
const { answer } = game.questions[game.round];
|
const { answer } = game.questions[game.round];
|
||||||
|
|
||||||
if (new RegExp(answer, 'i').test(message.body)) {
|
if (new RegExp(answer, 'i').test(decode(message.body))) { // resolve HTML entities, such as & to &
|
||||||
game.answers.push({
|
game.answers.push({
|
||||||
user: context.user,
|
user: context.user,
|
||||||
answer: message.body,
|
answer: message.body,
|
||||||
|
|
Loading…
Reference in New Issue