diff --git a/structures/Akinator.js b/structures/Akinator.js index 50114f01..87eb3905 100644 --- a/structures/Akinator.js +++ b/structures/Akinator.js @@ -1,4 +1,5 @@ const request = require('node-superfetch'); +const { decode: decodeHTML } = require('html-entities'); const regions = ['en', 'ar', 'cn', 'de', 'es', 'fr', 'il', 'it', 'jp', 'kr', 'nl', 'pt', 'ru', 'tr', 'id']; const answers = ['Yes', 'No', 'Don\'t know', 'Probably', 'Probably not']; @@ -30,11 +31,11 @@ class Akinator { this.session = text.match(/session: '(.+)'/)[1]; this.signature = text.match(/signature: '(.+)'/)[1]; this.answers = [ - text.match(/(.+)<\/a>/)[1], - text.match(/(.+)<\/a>/)[1], - text.match(/(.+)<\/a>/)[1], - text.match(/(.+)<\/a>/)[1], - text.match(/(.+)<\/a>/)[1] + decodeHTML(text.match(/(.+)<\/a>/)[1]), + decodeHTML(text.match(/(.+)<\/a>/)[1]), + decodeHTML(text.match(/(.+)<\/a>/)[1]), + decodeHTML(text.match(/(.+)<\/a>/)[1]), + decodeHTML(text.match(/(.+)<\/a>/)[1]) ]; return this; }