Skip to content

Commit

Permalink
Allow attachment updates on initial responses (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
DocJade authored Oct 21, 2024
1 parent b887224 commit 525bd69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/reply/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ impl CreateReply {
}

/// Add an attachment.
///
/// This will not have an effect in a slash command's initial response!
pub fn attachment(mut self, attachment: serenity::CreateAttachment) -> Self {
self.attachments.push(attachment);
self
Expand Down Expand Up @@ -157,7 +155,7 @@ impl CreateReply {
let crate::CreateReply {
content,
embeds,
attachments: _, // no support for attachment edits in serenity yet
attachments,
components,
ephemeral: _, // can't edit ephemerality in retrospect
allowed_mentions,
Expand All @@ -174,6 +172,9 @@ impl CreateReply {
if let Some(allowed_mentions) = allowed_mentions {
builder = builder.allowed_mentions(allowed_mentions);
}
for attachment in attachments {
builder = builder.new_attachment(attachment);
}

builder.embeds(embeds)
}
Expand Down

0 comments on commit 525bd69

Please sign in to comment.