@@ -3,7 +3,7 @@ import config from "../../data/config.json"
33import client from "../../main"
44import Command from "../../utils/Command"
55import { BotEmoji , Character , CharacterFull , CommandSource , SendMessage , Skill , TalentTable , TalentValue } from "../../utils/Types"
6- import { addArg , Bookmarkable , Colors , createTable , findFuzzyBestCandidatesForAutocomplete , getLink , getLinkToGuide , PAD_END , PAD_START , paginator , sendMessage , simplePaginator , urlify } from "../../utils/Utils"
6+ import { Bookmarkable , Colors , PAD_END , PAD_START , addArg , createTable , findFuzzyBestCandidatesForAutocomplete , getLink , getLinkToGuide , paginator , sendMessage , simplePaginator , splitByLength , urlify } from "../../utils/Utils"
77
88
99const elementTypes = client . data . getCharacters ( )
@@ -519,7 +519,6 @@ ${ Object
519519
520520 if ( skill . video && talentMode == "LITTLE" ) {
521521 embed . setImage ( getLink ( skill . video ) )
522- . setThumbnail ( "" )
523522 }
524523 }
525524
@@ -543,12 +542,18 @@ ${ Object
543542 embed . setTitle ( `${ char . name } : Passives` )
544543 . setURL ( `${ data . baseURL } characters/${ urlify ( char . name , false ) } #${ urlify ( skills . passive [ 0 ] . name , false ) } ` )
545544 for ( const passive of skills . passive ) {
546- if ( passive . minAscension )
547- embed . addFields ( { name : passive . name , value : `${ passive . desc }
545+ const descText = passive . minAscension ? `${ passive . desc }
548546
549- *${ passive . minAscension > 0 ? `Unlocks at ascension **${ passive . minAscension } **` : "Unlocked by **default**" } *` } )
550- else
551- embed . addFields ( { name : passive . name , value : passive . desc } )
547+ *${ passive . minAscension > 0 ? `Unlocks at ascension **${ passive . minAscension } **` : "Unlocked by **default**" } *` : passive . desc
548+
549+ const splitted = descText . split ( "\n\n" ) . flatMap ( x => splitByLength ( x , 1000 , "\n" ) )
550+ for ( let i = 0 ; i < splitted . length ; i ++ ) {
551+ const line = splitted [ i ]
552+ if ( i == 0 )
553+ embed . addFields ( { name : `${ passive . minAscension ? "*" : "" } ${ passive . name } ` , value : line } )
554+ else
555+ embed . addFields ( { name : ` ` , value : line } )
556+ }
552557 }
553558 return embed
554559 }
@@ -558,8 +563,17 @@ ${ Object
558563 . setURL ( `${ data . baseURL } characters/${ urlify ( char . name , false ) } #${ urlify ( skills . constellations [ 0 ] . name , false ) } ` )
559564 . setThumbnail ( getLink ( skills . constellations [ 0 ] ?. icon ) )
560565 let c = 0
561- for ( const constellation of skills . constellations )
562- embed . addFields ( { name : `C${ ++ c } : ${ constellation . name } ` , value : constellation . desc } )
566+ for ( const constellation of skills . constellations ) {
567+ const splitted = constellation . desc . split ( "\n\n" ) . flatMap ( x => splitByLength ( x , 1000 , "\n" ) )
568+
569+ for ( let i = 0 ; i < splitted . length ; i ++ ) {
570+ const line = splitted [ i ]
571+ if ( i == 0 )
572+ embed . addFields ( { name : `C${ ++ c } : ${ constellation . name } ` , value : line } )
573+ else
574+ embed . addFields ( { name : ` ` , value : line } )
575+ }
576+ }
563577
564578 return embed
565579 }
0 commit comments