File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ impl EditInteractionResponse {
7676 }
7777 super :: button_and_select_menu_convenience_methods!( self . 0 . components) ;
7878
79+ /// Sets the flags for the message.
80+ pub fn flags ( self , flags : MessageFlags ) -> Self {
81+ Self ( self . 0 . flags ( flags) )
82+ }
83+
7984 /// Sets attachments, see [`EditAttachments`] for more details.
8085 pub fn attachments ( self , attachments : EditAttachments ) -> Self {
8186 Self ( self . 0 . attachments ( attachments) )
Original file line number Diff line number Diff line change @@ -153,11 +153,10 @@ impl EditMessage {
153153 /// # Ok(()) }
154154 /// ```
155155 pub fn suppress_embeds ( mut self , suppress : bool ) -> Self {
156- // At time of writing, only `SUPPRESS_EMBEDS` can be set/unset when editing messages. See
157- // for details: https://discord.com/developers/docs/resources/channel#edit-message-jsonform-params
158- let flags = if suppress { MessageFlags :: SUPPRESS_EMBEDS } else { MessageFlags :: empty ( ) } ;
159-
160- self . flags = Some ( flags) ;
156+ // See for details: https://discord.com/developers/docs/resources/message#edit-message-jsonform-params
157+ self . flags
158+ . get_or_insert ( MessageFlags :: empty ( ) )
159+ . set ( MessageFlags :: SUPPRESS_EMBEDS , suppress) ;
161160 self
162161 }
163162
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ pub struct EditWebhookMessage {
2626 #[ serde( skip_serializing_if = "Option::is_none" ) ]
2727 embeds : Option < Vec < CreateEmbed > > ,
2828 #[ serde( skip_serializing_if = "Option::is_none" ) ]
29+ flags : Option < MessageFlags > ,
30+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
2931 allowed_mentions : Option < CreateAllowedMentions > ,
3032 #[ serde( skip_serializing_if = "Option::is_none" ) ]
3133 pub ( crate ) components : Option < Vec < CreateActionRow > > ,
@@ -131,6 +133,12 @@ impl EditWebhookMessage {
131133 }
132134 super :: button_and_select_menu_convenience_methods!( self . components) ;
133135
136+ /// Sets the flags for the message.
137+ pub fn flags ( mut self , flags : MessageFlags ) -> Self {
138+ self . flags = Some ( flags) ;
139+ self
140+ }
141+
134142 /// Sets attachments, see [`EditAttachments`] for more details.
135143 pub fn attachments ( mut self , attachments : EditAttachments ) -> Self {
136144 self . attachments = Some ( attachments) ;
You can’t perform that action at this time.
0 commit comments