From 6ea6349100a9cae0acbcac2d40e261f3b3210978 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 21 Mar 2020 20:52:03 -0400 Subject: [PATCH] MAL URL --- commands/search/anime.js | 5 +++-- commands/search/manga.js | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/commands/search/anime.js b/commands/search/anime.js index 30f2ecac..a621c4dc 100644 --- a/commands/search/anime.js +++ b/commands/search/anime.js @@ -112,6 +112,7 @@ module.exports = class AnimeCommand extends Command { if (!this.personalList) await this.fetchPersonalList(); const entry = this.personalList.find(ani => ani.mediaId === id); const malScore = await this.fetchMALScore(anime.idMal); + const malURL = `https://myanimelist.net/anime/${anime.idMal}`; const embed = new MessageEmbed() .setColor(0x02A9FF) .setAuthor('AniList', 'https://i.imgur.com/iUIRC7v.png', 'https://anilist.co/') @@ -122,9 +123,9 @@ module.exports = class AnimeCommand extends Command { .addField('❯ Status', statuses[anime.status], true) .addField('❯ Episodes', anime.episodes || '???', true) .addField('❯ Season', anime.season ? `${seasons[anime.season]} ${anime.startDate.year}` : '???', true) - .addField('❯ Average Score', anime.meanScore ? `${anime.meanScore}/100` : '???', true) + .addField('❯ Average Score', anime.meanScore ? `${anime.meanScore}%` : '???', true) .addField(`❯ ${ANILIST_USERNAME}'s Score`, entry && entry.score ? `${entry.score}/10` : '?/10', true) - .addField(`❯ MAL Score`, malScore ? `${malScore}/10` : '???', true); + .addField(`❯ MAL Score`, malScore ? `[${malScore}](${malURL})` : '???', true); return msg.embed(embed); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); diff --git a/commands/search/manga.js b/commands/search/manga.js index babed36d..4d8be34f 100644 --- a/commands/search/manga.js +++ b/commands/search/manga.js @@ -104,8 +104,9 @@ module.exports = class MangaCommand extends Command { if (!id) return msg.say('Could not find any results.'); const manga = await this.fetchManga(id); if (!this.personalList) await this.fetchPersonalList(); - const entry = this.personalList.find(manga => manga.mediaId === id); + const entry = this.personalList.find(ma => ma.mediaId === id); const malScore = await this.fetchMALScore(manga.idMal); + const malURL = `https://myanimelist.net/manga/${anime.idMal}`; const embed = new MessageEmbed() .setColor(0x02A9FF) .setAuthor('AniList', 'https://i.imgur.com/iUIRC7v.png', 'https://anilist.co/') @@ -116,9 +117,9 @@ module.exports = class MangaCommand extends Command { .addField('❯ Status', statuses[manga.status], true) .addField('❯ Chapters / Volumes', `${manga.chapters || '???'}/${manga.volumes || '???'}`, true) .addField('❯ Year', manga.startDate.year || '???', true) - .addField('❯ Average Score', manga.meanScore ? `${manga.meanScore}/100` : '???', 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}/10` : '???', true); + .addField(`❯ MAL Score`, malScore ? `[${malScore}](${malURL})` : '???', true); return msg.embed(embed); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);