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
@@ -2,7 +2,7 @@ const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const { stripIndents } = require('common-tags');
const { cleanAnilistHTML } = require('../../util/Util');
const { embedURL, cleanAnilistHTML } = require('../../util/Util');
const searchGraphQL = stripIndents`
query ($search: String) {
characters: Page (perPage: 1) {
@@ -85,7 +85,7 @@ module.exports = class CharacterCommand extends Command {
.setDescription(character.description ? cleanAnilistHTML(character.description) : 'No description.')
.addField(' Appearances', character.media.edges.map(edge => {
const title = edge.node.title.english || edge.node.title.userPreferred;
return `[${title} (${types[edge.node.type]})](${edge.node.siteUrl})`;
return embedURL(`${title} (${types[edge.node.type]})`, edge.node.siteUrl);
}).join(', '));
return msg.embed(embed);
} catch (err) {