Skip to content

Commit

Permalink
Add Poll to webhook message update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebm253 committed Aug 21, 2024
1 parent c00f264 commit ff380a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions discord/webhook_message_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type WebhookMessageUpdate struct {
Attachments *[]AttachmentUpdate `json:"attachments,omitempty"`
Files []*File `json:"-"`
AllowedMentions *AllowedMentions `json:"allowed_mentions,omitempty"`
Poll *PollCreate `json:"poll,omitempty"`
}

// ToBody returns the WebhookMessageUpdate ready for body
Expand Down
12 changes: 12 additions & 0 deletions discord/webhook_message_update_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@ func (b *WebhookMessageUpdateBuilder) ClearAllowedMentions() *WebhookMessageUpda
return b.SetAllowedMentions(nil)
}

// SetPoll sets the Poll of the webhook Message
func (b *WebhookMessageUpdateBuilder) SetPoll(poll PollCreate) *WebhookMessageUpdateBuilder {
b.Poll = &poll
return b
}

// ClearPoll clears the Poll of the webhook Message
func (b *WebhookMessageUpdateBuilder) ClearPoll() *WebhookMessageUpdateBuilder {
b.Poll = nil
return b
}

// Build builds the WebhookMessageUpdateBuilder to a MessageUpdate struct
func (b *WebhookMessageUpdateBuilder) Build() WebhookMessageUpdate {
return b.WebhookMessageUpdate
Expand Down

0 comments on commit ff380a9

Please sign in to comment.