mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 05:54:33 +02:00
Display links in all embed URLs
This commit is contained in:
@@ -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!`);
|
||||
|
||||
Reference in New Issue
Block a user