add stringwrap by words, limit ani description length

This commit is contained in:
bignutty 2025-01-28 03:20:58 +01:00
parent d58fa1fbe4
commit 19979e440e
3 changed files with 26 additions and 5 deletions

View file

@ -4,7 +4,7 @@ const { PERMISSION_GROUPS, OMNI_ANIME_FORMAT_TYPES } = require('#constants');
const { createEmbed, formatPaginationEmbeds, page, hexToEmbedColor } = require('#utils/embed');
const { acknowledge } = require('#utils/interactions');
const { smallPill, link, pill } = require('#utils/markdown');
const { smallPill, link, pill, stringwrapPreserveWords} = require('#utils/markdown');
const { editOrReply } = require('#utils/message');
const { InteractionContextTypes, ApplicationIntegrationTypes, ApplicationCommandOptionTypes } = require('detritus-client/lib/constants');
@ -30,7 +30,7 @@ function renderAnimeResultsPage(context, res){
if(res.subtitle) result.description += `-# ${res.subtitle}\n\n`;
if(res.subtype) result.description += pill(OMNI_ANIME_FORMAT_TYPES[res.subtype]) + " "
if(res.genres) result.description += res.genres.map((r)=>smallPill(r)).join(" ") + "\n\n";
if(res.description) result.description += res.description;
if(res.description) result.description += stringwrapPreserveWords(res.description, 600);
if(res.attribution?.description) result.description += `\n\n-# Source • ${res.attribution.description}`
// Render Images