mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 15:56:52 +02:00
MAL URL
This commit is contained in:
@@ -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!`);
|
||||
|
||||
@@ -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!`);
|
||||
|
||||
Reference in New Issue
Block a user