From c3875c8f809260a650ea9c632bf672ec9a9e874a Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 28 Oct 2017 15:03:06 +0000 Subject: [PATCH] Fix --- commands/search/my-anime-list-anime.js | 2 +- commands/search/my-anime-list-manga.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/search/my-anime-list-anime.js b/commands/search/my-anime-list-anime.js index 9c6d9750..cabe5360 100644 --- a/commands/search/my-anime-list-anime.js +++ b/commands/search/my-anime-list-anime.js @@ -30,7 +30,7 @@ module.exports = class MyAnimeListAnimeCommand extends Command { .get(`https://${MAL_LOGIN}@myanimelist.net/api/anime/search.xml`) .query({ q: query }); const body = xml2js(text, { compact: true }).anime; - const data = body.length ? body.entry[0] : body.entry; + const data = body.entry.length ? body.entry[0] : body.entry; const embed = new MessageEmbed() .setColor(0x2D54A2) .setAuthor('My Anime List', 'https://i.imgur.com/5rivpMM.png') diff --git a/commands/search/my-anime-list-manga.js b/commands/search/my-anime-list-manga.js index c0af0a11..f7ab50bf 100644 --- a/commands/search/my-anime-list-manga.js +++ b/commands/search/my-anime-list-manga.js @@ -30,7 +30,7 @@ module.exports = class MyAnimeListMangaCommand extends Command { .get(`https://${MAL_LOGIN}@myanimelist.net/api/manga/search.xml`) .query({ q: query }); const body = xml2js(text, { compact: true }).manga; - const data = body.length ? body.entry[0] : body.entry; + const data = body.entry.length ? body.entry[0] : body.entry; const embed = new MessageEmbed() .setColor(0x2D54A2) .setAuthor('My Anime List', 'https://i.imgur.com/5rivpMM.png')