File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ use super :: create_poll:: Ready ;
12#[ cfg( feature = "http" ) ]
23use super :: { check_overflow, Builder } ;
34use super :: {
45 CreateActionRow ,
56 CreateAllowedMentions ,
67 CreateAttachment ,
78 CreateEmbed ,
9+ CreatePoll ,
810 EditAttachments ,
911} ;
1012#[ cfg( feature = "http" ) ]
@@ -179,6 +181,8 @@ pub struct CreateInteractionResponseMessage {
179181 flags : Option < InteractionResponseFlags > ,
180182 #[ serde( skip_serializing_if = "Option::is_none" ) ]
181183 components : Option < Vec < CreateActionRow > > ,
184+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
185+ poll : Option < CreatePoll < Ready > > ,
182186 attachments : EditAttachments ,
183187}
184188
@@ -294,6 +298,15 @@ impl CreateInteractionResponseMessage {
294298 self . components = Some ( components) ;
295299 self
296300 }
301+
302+ /// Adds a poll to the message. Only one poll can be added per message.
303+ ///
304+ /// See [`CreatePoll`] for more information on creating and configuring a poll.
305+ pub fn poll ( mut self , poll : CreatePoll < Ready > ) -> Self {
306+ self . poll = Some ( poll) ;
307+ self
308+ }
309+
297310 super :: button_and_select_menu_convenience_methods!( self . components) ;
298311}
299312
Original file line number Diff line number Diff line change 1+ use super :: create_poll:: Ready ;
12#[ cfg( feature = "http" ) ]
23use super :: { check_overflow, Builder } ;
34use super :: {
45 CreateActionRow ,
56 CreateAllowedMentions ,
67 CreateAttachment ,
78 CreateEmbed ,
9+ CreatePoll ,
810 EditAttachments ,
911} ;
1012#[ cfg( feature = "http" ) ]
@@ -32,6 +34,8 @@ pub struct CreateInteractionResponseFollowup {
3234 components : Option < Vec < CreateActionRow > > ,
3335 #[ serde( skip_serializing_if = "Option::is_none" ) ]
3436 flags : Option < MessageFlags > ,
37+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
38+ poll : Option < CreatePoll < Ready > > ,
3539 attachments : EditAttachments ,
3640}
3741
@@ -154,6 +158,14 @@ impl CreateInteractionResponseFollowup {
154158 self
155159 }
156160
161+ /// Adds a poll to the message. Only one poll can be added per message.
162+ ///
163+ /// See [`CreatePoll`] for more information on creating and configuring a poll.
164+ pub fn poll ( mut self , poll : CreatePoll < Ready > ) -> Self {
165+ self . poll = Some ( poll) ;
166+ self
167+ }
168+
157169 /// Sets the components of this message.
158170 pub fn components ( mut self , components : Vec < CreateActionRow > ) -> Self {
159171 self . components = Some ( components) ;
You can’t perform that action at this time.
0 commit comments