File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ function createPlaygroundEmbed(
124
124
) {
125
125
const embed = new MessageEmbed ( )
126
126
. setColor ( TS_BLUE )
127
- . setTitle ( 'Shortened Playground Link' )
127
+ . setTitle ( 'Playground Link' )
128
128
. setAuthor ( author . tag , author . displayAvatarURL ( ) )
129
129
. setURL ( url ) ;
130
130
@@ -174,14 +174,18 @@ function createPlaygroundEmbed(
174
174
}
175
175
const prettyEndChar = pretty . length - ( normalized . length - endChar ) ;
176
176
const formattedSection = pretty . slice ( startChar , prettyEndChar ) ;
177
+ const content =
178
+ ( startChar === 0 ? '' : '...\n' ) +
179
+ formattedSection . replace ( / ^ \s * \n | \n \s * $ / g, '' ) +
180
+ ( prettyEndChar === pretty . length ? '' : '\n...' ) ;
177
181
178
182
if ( ! startLine && ! endLine ) {
179
183
embed . setFooter (
180
184
'You can choose specific lines to embed by selecting them before copying the link.' ,
181
185
) ;
182
186
}
183
187
184
- return embed . setDescription ( makeCodeBlock ( formattedSection ) ) ;
188
+ return embed . setDescription ( '**Preview:**' + makeCodeBlock ( content ) ) ;
185
189
}
186
190
187
191
async function shortenPlaygroundLink ( url : string ) {
You can’t perform that action at this time.
0 commit comments