mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
const { unescape } = require('html-escaper');
|
||||
const Entities = require('html-entities').AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { verify } = require('../../util/Util');
|
||||
|
||||
@@ -29,7 +30,7 @@ module.exports = class WillYouPressTheButtonCommand extends Command {
|
||||
try {
|
||||
const dilemma = await this.fetchDilemma();
|
||||
await msg.reply(stripIndents`
|
||||
**${unescape(dilemma.txt1)}** but **${unescape(dilemma.txt2)}**
|
||||
**${entities.decode(dilemma.txt1)}** but **${entities.decode(dilemma.txt2)}**
|
||||
|
||||
Will you press the button?
|
||||
_Respond with [y]es or [n]o to continue._
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
"eslint": "^7.11.0",
|
||||
"gifencoder": "^2.0.1",
|
||||
"gm": "^1.23.1",
|
||||
"html-escaper": "^3.0.0",
|
||||
"html-entities": "^1.3.1",
|
||||
"js-beautify": "^1.13.0",
|
||||
"mathjs": "^7.5.1",
|
||||
"moment": "^2.29.1",
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
const crypto = require('crypto');
|
||||
const { unescape } = require('html-escaper');
|
||||
const Entities = require('html-entities').AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { SUCCESS_EMOJI_ID } = process.env;
|
||||
const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea', 'ya', 'hai', 'si', 'sí', 'oui', 'はい', 'correct'];
|
||||
const no = ['no', 'n', 'nah', 'nope', 'nop', 'iie', 'いいえ', 'non', 'fuck off'];
|
||||
@@ -206,7 +207,7 @@ module.exports = class Util {
|
||||
static cleanAnilistHTML(html, removeLineBreaks = true) {
|
||||
let clean = html;
|
||||
if (removeLineBreaks) clean = clean.replace(/\r|\n|\f/g, '');
|
||||
clean = unescape(clean);
|
||||
clean = entities.decode(clean);
|
||||
clean = clean
|
||||
.replace(/<br/g, '\n')
|
||||
.replace(/<\/?i>/g, '*')
|
||||
|
||||
Reference in New Issue
Block a user