Compare commits

..

2 Commits

Author SHA1 Message Date
ThePendulum 2ddac57365 1.5.8 2021-11-15 20:29:15 +01:00
ThePendulum a5fb878192 Resolve message body HTML entities in Trivia bot. 2021-11-15 20:29:13 +01:00
3 changed files with 17 additions and 4 deletions

15
package-lock.json generated
View File

@ -1,17 +1,18 @@
{
"name": "schat2-clive",
"version": "1.5.7",
"version": "1.5.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.5.7",
"version": "1.5.8",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",
"bottleneck": "^2.19.5",
"config": "^3.3.6",
"html-entities": "^2.3.2",
"jsdom": "^18.1.0",
"linkify-it": "^3.0.3",
"simple-node-logger": "^21.8.12",
@ -1906,6 +1907,11 @@
"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": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",
@ -5159,6 +5165,11 @@
"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": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.5.7",
"version": "1.5.8",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {
@ -21,6 +21,7 @@
"bhttp": "^1.2.8",
"bottleneck": "^2.19.5",
"config": "^3.3.6",
"html-entities": "^2.3.2",
"jsdom": "^18.1.0",
"linkify-it": "^3.0.3",
"simple-node-logger": "^21.8.12",

View File

@ -2,6 +2,7 @@
const config = require('config');
const timers = require('timers/promises');
const { decode } = require('html-entities');
const questions = require('../../assets/jeopardy.json');
const shuffle = require('../utils/shuffle');
@ -171,7 +172,7 @@ async function onMessage(message, context) {
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({
user: context.user,
answer: message.body,