Browse Source

Decode html entities in question

pull/18/head
Abheek Dhawan 3 years ago
parent
commit
acd431b035
  1. 3
      index.js
  2. 11
      package-lock.json
  3. 1
      package.json

3
index.js

@ -15,6 +15,7 @@ const generatedRound = require("./mongooseModels/mongooseGeneratedRoundModel.js"
const mongoose = require("mongoose"); const mongoose = require("mongoose");
const gitlog = require("gitlog").default; const gitlog = require("gitlog").default;
const config = require("./config.json"); const config = require("./config.json");
const decode = require('html-entities').decode;
const helpMessage = "AwesomeSciBo has migrated to using slash commands! You can take a look at the different commands by typing `/` and clicking on the AwesomeSciBo icon." const helpMessage = "AwesomeSciBo has migrated to using slash commands! You can take a look at the different commands by typing `/` and clicking on the AwesomeSciBo icon."
@ -263,7 +264,7 @@ async function training(subject, interaction) {
const tossupQuestion = data.tossup_question; const tossupQuestion = data.tossup_question;
const tossupAnswer = data.tossup_answer; const tossupAnswer = data.tossup_answer;
const messageFilter = (m) => m.author.id === authorId; const messageFilter = (m) => m.author.id === authorId;
interaction.reply({ content: tossupQuestion + `\n\n||Source: ${data.uri}||` }) interaction.reply({ content: decode(tossupQuestion) + `\n\n||Source: ${data.uri}||` })
.then(() => { .then(() => {
interaction.channel.awaitMessages({ interaction.channel.awaitMessages({
messageFilter, messageFilter,

11
package-lock.json

@ -15,6 +15,7 @@
"eslint": "^7.21.0", "eslint": "^7.21.0",
"fs": "^0.0.1-security", "fs": "^0.0.1-security",
"gitlog": "^4.0.4", "gitlog": "^4.0.4",
"html-entities": "^2.3.2",
"mongoose": "^5.12.5", "mongoose": "^5.12.5",
"node-fetch": "^2.6.1" "node-fetch": "^2.6.1"
}, },
@ -927,6 +928,11 @@
"node": ">=8" "node": ">=8"
} }
}, },
"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/ignore": { "node_modules/ignore": {
"version": "4.0.6", "version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
@ -2480,6 +2486,11 @@
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="
}, },
"html-entities": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz",
"integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ=="
},
"ignore": { "ignore": {
"version": "4.0.6", "version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",

1
package.json

@ -6,6 +6,7 @@
"eslint": "^7.21.0", "eslint": "^7.21.0",
"fs": "^0.0.1-security", "fs": "^0.0.1-security",
"gitlog": "^4.0.4", "gitlog": "^4.0.4",
"html-entities": "^2.3.2",
"mongoose": "^5.12.5", "mongoose": "^5.12.5",
"node-fetch": "^2.6.1" "node-fetch": "^2.6.1"
}, },

Loading…
Cancel
Save