diff --git a/polls.go b/polls.go new file mode 100644 index 0000000..841d209 --- /dev/null +++ b/polls.go @@ -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"` +} diff --git a/status.go b/status.go index 2f6bdd7..e0d955f 100644 --- a/status.go +++ b/status.go @@ -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"`