diff --git a/commands/games-sp/will-you-press-the-button.js b/commands/games-sp/will-you-press-the-button.js index faace553..32d8a989 100644 --- a/commands/games-sp/will-you-press-the-button.js +++ b/commands/games-sp/will-you-press-the-button.js @@ -1,7 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); -const Entities = require('html-entities').AllHtmlEntities; -const entities = new Entities(); +const { decode: decodeHTML } = require('html-entities'); const { stripIndents } = require('common-tags'); const { verify, formatNumber } = require('../../util/Util'); @@ -30,7 +29,7 @@ module.exports = class WillYouPressTheButtonCommand extends Command { try { const dilemma = await this.fetchDilemma(); await msg.reply(stripIndents` - **${entities.decode(dilemma.txt1)}** but **${entities.decode(dilemma.txt2)}** + **${decodeHTML(dilemma.txt1)}** but **${decodeHTML(dilemma.txt2)}** Will you press the button? _Respond with [y]es or [n]o to continue._ diff --git a/util/Util.js b/util/Util.js index d2742534..5653b992 100644 --- a/util/Util.js +++ b/util/Util.js @@ -1,6 +1,5 @@ const crypto = require('crypto'); -const Entities = require('html-entities').AllHtmlEntities; -const entities = new Entities(); +const { decode: decodeHTML } = require('html-entities'); const { stripIndents } = require('common-tags'); const { SUCCESS_EMOJI_ID } = process.env; const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea', 'ya', 'hai', 'si', 'sí', 'oui', 'はい', 'correct']; @@ -270,7 +269,7 @@ module.exports = class Util { static cleanAnilistHTML(html, removeLineBreaks = true) { let clean = html; if (removeLineBreaks) clean = clean.replace(/\r|\n|\f/g, ''); - clean = entities.decode(clean); + clean = decodeHTML(clean); clean = clean .replaceAll('
', '\n') .replace(/<\/?i>/g, '*')