promisifyAll in xml2js

This commit is contained in:
Daniel Odendahl Jr
2017-05-25 23:50:48 +00:00
parent fba5f67b48
commit 1e2a0d48ed
5 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
const { promisify } = require('tsubaki');
const xml = promisify(require('xml2js').parseString);
const { promisifyAll } = require('tsubaki');
const xml = promisifyAll(require('xml2js'));
const { ANIMELIST_LOGIN } = process.env;
module.exports = class AnimeCommand extends Command {
@@ -33,7 +33,7 @@ module.exports = class AnimeCommand extends Command {
.query({
q: query
});
const { anime } = await xml(text);
const { anime } = await xml.parseString(text);
const synopsis = anime.entry[0].synopsis[0].substr(0, 2000)
.replace(/(<br \/>)/g, '')
.replace(/(&#039;)/g, '\'')