diff --git a/commands/events/horoscope.js b/commands/events/horoscope.js index 308547a1..f8c0ed74 100644 --- a/commands/events/horoscope.js +++ b/commands/events/horoscope.js @@ -42,6 +42,7 @@ module.exports = class HoroscopeCommand extends Command { .setTitle(`Horoscope for ${firstUpperCase(sign)}...`) .setURL(`https://astrology.tv/horoscope/signs/${sign}/`) .setFooter('© Kelli Fox, The Astrologer') + .setThumbnail(this.getImageURL(sign)) .setTimestamp() .setDescription(horoscope); return msg.embed(embed); @@ -55,4 +56,8 @@ module.exports = class HoroscopeCommand extends Command { const $ = cheerio.load(text); return $('div[class="ct-text-block day-tabs-content_horoscope"]').eq(1).text(); } + + getImageURL(sign) { + return `https://astrology.tv/wp-content/uploads/2019/07/astrology_tv_${sign}_cover-768x768.jpg`; + } }; diff --git a/commands/random-res/superpower.js b/commands/random-res/superpower.js index 40ae032a..bd5821cb 100644 --- a/commands/random-res/superpower.js +++ b/commands/random-res/superpower.js @@ -1,7 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); const { stripIndents } = require('common-tags'); -const { shorten } = require('../../util/Util'); module.exports = class SuperpowerCommand extends Command { constructor(client) { @@ -32,7 +31,7 @@ module.exports = class SuperpowerCommand extends Command { const article = await this.fetchSuperpower(id); return msg.reply(stripIndents` Your superpower is... **${article.title}**! - _${shorten(article.content.map(section => section.text).join('\n\n'), 1950)}_ + _${article.abstract}_ `); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); @@ -41,7 +40,7 @@ module.exports = class SuperpowerCommand extends Command { async random() { const { body } = await request - .get('http://powerlisting.wikia.com/api.php') + .get('http://powerlisting.fandom.com/api.php') .query({ action: 'query', list: 'random', @@ -55,8 +54,8 @@ module.exports = class SuperpowerCommand extends Command { async fetchSuperpower(id) { const { body } = await request - .get('http://powerlisting.wikia.com/api/v1/Articles/AsSimpleJson/') - .query({ id }); - return body.sections[0]; + .get('https://powerlisting.fandom.com/api/v1/Articles/Details') + .query({ ids: id }); + return body.items[id.toString()]; } }; diff --git a/commands/search/mayo-clinic.js b/commands/search/mayo-clinic.js index 0bc52baa..e51bb7bd 100644 --- a/commands/search/mayo-clinic.js +++ b/commands/search/mayo-clinic.js @@ -66,7 +66,7 @@ module.exports = class MayoClinicCommand extends Command { return { name: $('h1').first().text().trim(), url: location, - description: $('p').first().text().trim() + description: $('p').eq(2).text().trim() }; } return location; diff --git a/commands/search/poem.js b/commands/search/poem.js index 3228234c..26832b74 100644 --- a/commands/search/poem.js +++ b/commands/search/poem.js @@ -1,6 +1,7 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); const { html } = require('common-tags'); +const { shorten } = require('../../util/Util'); module.exports = class PoemCommand extends Command { constructor(client) { @@ -42,7 +43,7 @@ module.exports = class PoemCommand extends Command { const data = body[0]; return msg.say(html` **${data.title}** by **${data.author}** - ${data.lines.join('\n')} + ${shorten(data.lines.join('\n'), 1750)} `); } catch (err) { if (err.status === 404) return msg.say('Could not find any results.'); diff --git a/commands/search/pornhub.js b/commands/search/pornhub.js index 15ad5665..d552e785 100644 --- a/commands/search/pornhub.js +++ b/commands/search/pornhub.js @@ -43,7 +43,7 @@ module.exports = class PornhubCommand extends Command { .query({ search: query }); if (text.includes('