From cb294acc8efd6d7c9ea0a8d72ccb847c6d1667ab Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 21 Aug 2017 10:45:43 +0000 Subject: [PATCH] Fix Bugs --- commands/search/movie.js | 2 +- commands/search/tv-show.js | 2 +- commands/search/wikia.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/search/movie.js b/commands/search/movie.js index 17fa2528..ebff2971 100644 --- a/commands/search/movie.js +++ b/commands/search/movie.js @@ -47,7 +47,7 @@ module.exports = class MovieCommand extends Command { .addField('❯ Release Date', body.release_date, true) .addField('❯ Genres', - body.genres.map(genre => genre.name).join(', ')) + body.genres.length ? body.genres.map(genre => genre.name).join(', ') : 'N/A') .addField('❯ Production Companies', body.production_companies.length ? body.production_companies.map(company => company.name).join(', ') : 'N/A'); return msg.embed(embed); diff --git a/commands/search/tv-show.js b/commands/search/tv-show.js index 239d3d8e..adfdb626 100644 --- a/commands/search/tv-show.js +++ b/commands/search/tv-show.js @@ -51,7 +51,7 @@ module.exports = class TVShowCommand extends Command { .addField('❯ Episodes', body.number_of_episodes, true) .addField('❯ Genres', - body.genres.map(genre => genre.name).join(', ')) + body.genres.length ? body.genres.map(genre => genre.name).join(', ') : 'N/A') .addField('❯ Production Companies', body.production_companies.length ? body.production_companies.map(company => company.name).join(', ') : 'N/A'); return msg.embed(embed); diff --git a/commands/search/wikia.js b/commands/search/wikia.js index b7579f04..44072d12 100644 --- a/commands/search/wikia.js +++ b/commands/search/wikia.js @@ -45,7 +45,7 @@ module.exports = class WikiaCommand extends Command { .setURL(search.body.items[0].url) .setAuthor('Wikia', 'https://i.imgur.com/WzXWJka.png') .setDescription(body.sections[0].content.map(i => i.text).join('\n\n').substr(0, 2048)) - .setThumbnail(body.sections[0].images[0] ? body.sections[0].images[0].src : null); + .setThumbnail(body.sections[0].images.length ? body.sections[0].images[0].src : null); return msg.embed(embed); } catch (err) { return msg.say('No Results or Invalid Wiki.'); diff --git a/package.json b/package.json index 73e6d15b..da5e62b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "30.7.2", + "version": "30.7.3", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {