From c2ed43b3be844d68cb0e1e95c6cb6cfd536b262e Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 16 Feb 2019 02:17:41 +0000 Subject: [PATCH] Fix --- commands/search/anime.js | 2 +- commands/search/character.js | 6 ++++-- commands/search/manga.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/search/anime.js b/commands/search/anime.js index 382a288d..c84ba0dd 100644 --- a/commands/search/anime.js +++ b/commands/search/anime.js @@ -77,7 +77,7 @@ module.exports = class AnimeCommand extends Command { .setURL(anime.siteUrl) .setThumbnail(anime.coverImage.large || anime.coverImage.medium || null) .setTitle(anime.title.english || anime.title.userPreferred) - .setDescription(anime.description ? shorten(anime.description) : 'No description.') + .setDescription(anime.description ? shorten(anime.description.replace(/(
)+/g, '\n')) : 'No description.') .addField('❯ Status', statuses[anime.status], true) .addField('❯ Episodes', anime.episodes || '???', true) .addField('❯ Season', anime.season ? `${seasons[anime.season]} ${anime.startDate.year}` : '???', true) diff --git a/commands/search/character.js b/commands/search/character.js index 839d31c4..c740fa1d 100644 --- a/commands/search/character.js +++ b/commands/search/character.js @@ -71,8 +71,10 @@ module.exports = class CharacterCommand extends Command { .setURL(character.siteUrl) .setThumbnail(character.image.large || character.image.medium || null) .setTitle(character.name.native) - .setDescription(character.description ? shorten(character.description) : 'No description.') - .addField('❯ Appearances', character.edges.map(edge => { + .setDescription(character.description + ? shorten(character.description.replace(/(
)+/g, '\n')) + : '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})`; }).join(', ')); diff --git a/commands/search/manga.js b/commands/search/manga.js index 3d3f44aa..eba7200e 100644 --- a/commands/search/manga.js +++ b/commands/search/manga.js @@ -68,7 +68,7 @@ module.exports = class MangaCommand extends Command { .setURL(manga.siteUrl) .setThumbnail(manga.coverImage.large || manga.coverImage.medium || null) .setTitle(manga.title.english || manga.title.userPreferred) - .setDescription(manga.description ? shorten(manga.description) : 'No description.') + .setDescription(manga.description ? shorten(manga.description.replace(/(
)+/g, '\n')) : 'No description.') .addField('❯ Status', statuses[manga.status], true) .addField('❯ Chapters / Volumes', `${manga.chapters || '???'}/${manga.volumes || '???'}`, true) .addField('❯ Year', manga.startDate.year || '???', true)