Skip to content

Commit

Permalink
Allow polls to be constructed in a interation response (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexedia authored Oct 16, 2024
1 parent d93aa12 commit db27c54
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/builders/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,17 @@ class MessageUpdateBuilder extends UpdateBuilder<Message> {

List<AttachmentBuilder>? attachments;

/// Can only be used when editing a deferred interaction.
PollBuilder? poll;

MessageUpdateBuilder({
this.content = sentinelString,
this.embeds = sentinelList,
this.suppressEmbeds,
this.allowedMentions,
this.components,
this.attachments = sentinelList,
this.poll,
});

@override
Expand All @@ -140,6 +144,7 @@ class MessageUpdateBuilder extends UpdateBuilder<Message> {
if (components != null) 'components': components!.map((e) => e.build()).toList(),
if (!identical(attachments, sentinelList)) 'attachments': attachments!.map((e) => e.build()).toList(),
if (suppressEmbeds != null) 'flags': (suppressEmbeds == true ? MessageFlags.suppressEmbeds.value : 0),
if (poll != null) 'poll': poll!.build(),
};
}

Expand Down

0 comments on commit db27c54

Please sign in to comment.