Skip to content

Commit

Permalink
Refactor attachment upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Sep 29, 2024
1 parent 7f1fc93 commit 91eacc1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,12 @@ private void applyMessage(
messageBuilder.withBody(message.messageText());
}
if (!message.attachments().isEmpty()) {
final var uploadedAttachments = context.getAttachmentHelper().uploadAttachments(message.attachments());
if (!additionalAttachments.isEmpty()) {
additionalAttachments.addAll(context.getAttachmentHelper().uploadAttachments(message.attachments()));
additionalAttachments.addAll(uploadedAttachments);
messageBuilder.withAttachments(additionalAttachments);
} else {
messageBuilder.withAttachments(context.getAttachmentHelper().uploadAttachments(message.attachments()));
messageBuilder.withAttachments(uploadedAttachments);
}
}
if (!message.mentions().isEmpty()) {
Expand Down

0 comments on commit 91eacc1

Please sign in to comment.