@@ -148,12 +148,13 @@ public void acceptSubmission(InteractionHook hook, @NotNull ThreadChannel thread
148148 WebhookUtil .ensureWebhookExists (newestPost .getParentChannel ().asForumChannel (), wh ->
149149 getMessagesByUser (thread , author ).thenAccept (messages -> {
150150 for (Message message : messages ) {
151+ boolean lastMessage = messages .indexOf (message ) + 1 == messages .size ();
151152 if (message .getAuthor ().isBot () || message .getType () != MessageType .DEFAULT ) continue ;
152153 if (message .getContentRaw ().length () > 2000 ) {
153154 WebhookUtil .mirrorMessageToWebhook (wh , message , message .getContentRaw ().substring (0 , 2000 ), newestPost .getIdLong (), null , null );
154- WebhookUtil .mirrorMessageToWebhook (wh , message , message .getContentRaw ().substring (2000 ), newestPost .getIdLong (), null , List .of (buildAuthorEmbed (author , bestAnswer )));
155+ WebhookUtil .mirrorMessageToWebhook (wh , message , message .getContentRaw ().substring (2000 ), newestPost .getIdLong (), null , lastMessage ? List .of (buildAuthorEmbed (author , bestAnswer )) : null );
155156 } else {
156- WebhookUtil .mirrorMessageToWebhook (wh , message , message .getContentRaw (), newestPost .getIdLong (), null , List .of (buildAuthorEmbed (author , bestAnswer )));
157+ WebhookUtil .mirrorMessageToWebhook (wh , message , message .getContentRaw (), newestPost .getIdLong (), null , lastMessage ? List .of (buildAuthorEmbed (author , bestAnswer )) : null );
157158 }
158159 }
159160 }));
0 commit comments