@@ -157,31 +157,32 @@ private async Task HandleExistingStarReaction(DataContext db, IUserMessage messa
157
157
return ;
158
158
}
159
159
160
+ // Send to starboard channel as it has reached the minimum stars threshold
161
+
160
162
var starboardChannel = await client . GetChannelAsync ( dbStarboardChannel . Snowflake ) as ITextChannel ;
161
163
var embed = new EmbedBuilder
162
164
{
163
- Title = "Message Link" ,
164
- ThumbnailUrl = message . Author . GetAvatarUrl ( ) ,
165
165
Color = EmbedColors . Normal ,
166
- Fields = [
167
- new EmbedFieldBuilder
168
- {
169
- Name = "Author" ,
170
- Value = message . Author . Username ,
171
- IsInline = true ,
172
- } ,
173
-
174
- new EmbedFieldBuilder
175
- {
176
- Name = "Message" ,
177
- Value = message . Content ,
178
- IsInline = true ,
179
- } ,
180
- ] ,
181
- Url = message . GetJumpUrl ( ) ,
182
- } ;
183
-
184
- await starboardChannel . SendMessageAsync ( embed : embed . Build ( ) ) ;
166
+ Description = $ "{ message . Content } \n \n [Message Link]({ message . GetJumpUrl ( ) } )",
167
+ ImageUrl = message . Attachments . FirstOrDefault ( ) ? . Url ,
168
+ } . WithAuthor ( message . Author ) ;
169
+
170
+ // Add attachments
171
+ var attachments = message . Attachments . Skip ( 1 ) ;
172
+ var attachmentsLength = attachments . Count ( ) ;
173
+
174
+ Embed [ ] embeds = new Embed [ attachmentsLength + 1 ] ;
175
+ embeds [ 0 ] = embed . Build ( ) ;
176
+
177
+ for ( int i = 0 ; i < attachmentsLength ; i ++ ) {
178
+ embeds [ i + 1 ] = new EmbedBuilder
179
+ {
180
+ ImageUrl = attachments . ElementAt ( i ) . Url ,
181
+ Color = EmbedColors . Normal ,
182
+ } . Build ( ) ;
183
+ }
184
+
185
+ await starboardChannel . SendMessageAsync ( embeds : embeds ) ;
185
186
186
187
starReaction . IsOnStarboard = true ;
187
188
await db . SaveChangesAsync ( ) ;
0 commit comments