From 3e003b676bab7cdc9e1c3b99f5feaeb9c87bc6cb Mon Sep 17 00:00:00 2001 From: Lexedia Date: Sun, 13 Oct 2024 01:25:06 +0200 Subject: [PATCH] Allow polls to be constructed in a interation response --- lib/src/builders/message/message.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/builders/message/message.dart b/lib/src/builders/message/message.dart index 8ef92ff4b..7a08aa377 100644 --- a/lib/src/builders/message/message.dart +++ b/lib/src/builders/message/message.dart @@ -123,6 +123,9 @@ class MessageUpdateBuilder extends UpdateBuilder { List? attachments; + /// Can only be used when editing a deferred interaction. + PollBuilder? poll; + MessageUpdateBuilder({ this.content = sentinelString, this.embeds = sentinelList, @@ -130,6 +133,7 @@ class MessageUpdateBuilder extends UpdateBuilder { this.allowedMentions, this.components, this.attachments = sentinelList, + this.poll, }); @override @@ -140,6 +144,7 @@ class MessageUpdateBuilder extends UpdateBuilder { 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(), }; }