Skip to content

Commit 7ca41a0

Browse files
authored
Add Poll to webhook message update (#384)
1 parent b477491 commit 7ca41a0

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

discord/webhook_message_update.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type WebhookMessageUpdate struct {
88
Attachments *[]AttachmentUpdate `json:"attachments,omitempty"`
99
Files []*File `json:"-"`
1010
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
11+
Poll *PollCreate `json:"poll,omitempty"`
1112
}
1213

1314
// ToBody returns the WebhookMessageUpdate ready for body

discord/webhook_message_update_builder.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,18 @@ func (b *WebhookMessageUpdateBuilder) ClearAllowedMentions() *WebhookMessageUpda
211211
return b.SetAllowedMentions(nil)
212212
}
213213

214+
// SetPoll sets the Poll of the webhook Message
215+
func (b *WebhookMessageUpdateBuilder) SetPoll(poll PollCreate) *WebhookMessageUpdateBuilder {
216+
b.Poll = &poll
217+
return b
218+
}
219+
220+
// ClearPoll clears the Poll of the webhook Message
221+
func (b *WebhookMessageUpdateBuilder) ClearPoll() *WebhookMessageUpdateBuilder {
222+
b.Poll = nil
223+
return b
224+
}
225+
214226
// Build builds the WebhookMessageUpdateBuilder to a MessageUpdate struct
215227
func (b *WebhookMessageUpdateBuilder) Build() WebhookMessageUpdate {
216228
return b.WebhookMessageUpdate

0 commit comments

Comments
 (0)