Skip to content

Commit 3009d22

Browse files
authored
Add support for editing flags on Webhook/Interaction responses (#3381)
1 parent ffaf185 commit 3009d22

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/builder/edit_interaction_response.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ impl<'a> EditInteractionResponse<'a> {
9898
Self(self.0.clear_attachments())
9999
}
100100

101+
/// Sets the flags for this message.
102+
pub fn flags(mut self, flags: MessageFlags) -> Self {
103+
self.0.flags = Some(flags);
104+
self
105+
}
106+
101107
/// Edits the initial interaction response. Does not work for ephemeral messages.
102108
///
103109
/// The `application_id` used will usually be the bot's [`UserId`], except if the bot is very

src/builder/edit_webhook_message.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pub struct EditWebhookMessage<'a> {
2929
pub(crate) components: Option<Cow<'a, [CreateComponent<'a>]>>,
3030
#[serde(skip_serializing_if = "Option::is_none")]
3131
pub(crate) attachments: Option<EditAttachments<'a>>,
32+
#[serde(skip_serializing_if = "Option::is_none")]
33+
pub(crate) flags: Option<MessageFlags>,
3234

3335
#[serde(skip)]
3436
thread_id: Option<ThreadId>,
@@ -142,6 +144,12 @@ impl<'a> EditWebhookMessage<'a> {
142144
self
143145
}
144146

147+
/// Sets the flags for this message.
148+
pub fn flags(mut self, flags: MessageFlags) -> Self {
149+
self.flags = Some(flags);
150+
self
151+
}
152+
145153
/// Edits the webhook's message.
146154
///
147155
/// **Note**: Message contents must be under 2000 unicode code points, and embeds must be under

0 commit comments

Comments
 (0)