Change to process.env

This commit is contained in:
Daniel Odendahl Jr
2017-08-13 01:33:56 +00:00
parent e75251b3f9
commit 71c9691419
23 changed files with 46 additions and 248 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ const snekfetch = require('snekfetch');
const { cleanXML } = require('../../structures/Util');
const { promisifyAll } = require('tsubaki');
const xml = promisifyAll(require('xml2js'));
const { animelistLogin } = require('../../config');
const { ANIMELIST_LOGIN } = process.env;
module.exports = class AnimeCommand extends Command {
constructor(client) {
@@ -28,7 +28,7 @@ module.exports = class AnimeCommand extends Command {
const { query } = args;
try {
const { text } = await snekfetch
.get(`https://${animelistLogin}@myanimelist.net/api/anime/search.xml`)
.get(`https://${ANIMELIST_LOGIN}@myanimelist.net/api/anime/search.xml`)
.query({ q: query });
const { anime } = await xml.parseStringAsync(text);
const synopsis = cleanXML(anime.entry[0].synopsis[0].substr(0, 2048));