File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -224,22 +224,24 @@ async function manageBoard (reaction) {
224224 if ( data . content . length > MAXLENGTH - data . contentInfo . length )
225225 data . content = `${ data . content . substring ( 0 , MAXLENGTH - data . contentInfo . length ) } ...`
226226
227+ // set first image
228+ const first_image = ( data . imageURLs . length ) ? data . imageURLs . shift ( ) : null
227229 // set message embed color
228230 const hexcolor = ( settings . hexcolor ) ? settings . hexcolor : parseInt ( msg . channel . id ) . toString ( 16 ) . substring ( 2 , 8 )
229231
230232 // attach all embeds
231233 const embeds = [
232234 new EmbedBuilder ( )
233- . setURL ( "https://risu.dev/" )
235+ . setURL ( first_image )
234236 . setAuthor ( { name : msg . author . username , iconURL : data . avatarURL , url : `https://discordapp.com/users/${ msg . author . id } ` } )
235237 . setColor ( hexcolor )
236238 . setDescription ( data . content + data . contentInfo )
237- . setImage ( ( data . imageURLs . length ) ? data . imageURLs . shift ( ) : null )
239+ . setImage ( first_image )
238240 . setTimestamp ( new Date ( ) )
239241 . setFooter ( { text : data . footer , iconURL : null } ) ,
240242 ]
241243 data . imageURLs . forEach ( url => {
242- embeds . push ( new EmbedBuilder ( ) . setURL ( "https://risu.dev/" ) . setImage ( url ) )
244+ embeds . push ( new EmbedBuilder ( ) . setURL ( first_image ) . setImage ( url ) )
243245 } )
244246
245247 // post embed
You can’t perform that action at this time.
0 commit comments