Display links in all embed URLs

This commit is contained in:
Dragon Fire
2020-03-28 21:57:02 -04:00
parent 3ce12b79cd
commit 1c272e3307
17 changed files with 44 additions and 36 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const cheerio = require('cheerio');
const { stripIndents } = require('common-tags');
const { cleanAnilistHTML } = require('../../util/Util');
const { embedURL, cleanAnilistHTML } = require('../../util/Util');
const ANILIST_USERNAME = process.env.ANILIST_USERNAME || 'dragonfire535';
const searchGraphQL = stripIndents`
query ($search: String, $type: MediaType, $isAdult: Boolean) {
@@ -119,7 +119,7 @@ module.exports = class MangaCommand extends Command {
.addField(' Year', manga.startDate.year || '???', true)
.addField(' Average Score', manga.meanScore ? `${manga.meanScore}%` : '???', true)
.addField(` ${ANILIST_USERNAME}'s Score`, entry && entry.score ? `${entry.score}/10` : '?/10', true)
.addField(` MAL Score`, malScore ? `[${malScore}](${malURL})` : '???', true);
.addField(` MAL Score`, malScore ? embedURL(malScore, malURL) : '???', true);
return msg.embed(embed);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);