Added polls entity, available since API 2.8.0

This commit is contained in:
Christian Muehlhaeuser 2019-05-13 01:46:11 +02:00
parent e725c81450
commit 19b057d655
No known key found for this signature in database
GPG key ID: 3CF9FA45CA1EBB7E
2 changed files with 21 additions and 0 deletions

20
polls.go Normal file
View file

@ -0,0 +1,20 @@
package mastodon
import "time"
// Poll hold information for mastodon polls.
type Poll struct {
ID ID `json:"id"`
ExpiresAt time.Time `json:"expires_at"`
Expired bool `json:"expired"`
Multiple bool `json:"multiple"`
VotesCount int64 `json:"votes_count"`
Options []PollOption `json:"options"`
Voted bool `json:"voted"`
}
// Poll hold information for a mastodon poll option.
type PollOption struct {
Title string `json:"title"`
VotesCount int64 `json:"votes_count"`
}

View file

@ -34,6 +34,7 @@ type Status struct {
Mentions []Mention `json:"mentions"`
Tags []Tag `json:"tags"`
Card *Card `json:"card"`
Poll *Poll `json:"poll"`
Application Application `json:"application"`
Language string `json:"language"`
Pinned interface{} `json:"pinned"`