Added polls entity, available since API 2.8.0
This commit is contained in:
parent
1c0769492b
commit
3e91c76504
20
polls.go
Normal file
20
polls.go
Normal 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"`
|
||||||
|
}
|
|
@ -34,6 +34,7 @@ type Status struct {
|
||||||
Mentions []Mention `json:"mentions"`
|
Mentions []Mention `json:"mentions"`
|
||||||
Tags []Tag `json:"tags"`
|
Tags []Tag `json:"tags"`
|
||||||
Card *Card `json:"card"`
|
Card *Card `json:"card"`
|
||||||
|
Poll *Poll `json:"poll"`
|
||||||
Application Application `json:"application"`
|
Application Application `json:"application"`
|
||||||
Language string `json:"language"`
|
Language string `json:"language"`
|
||||||
Pinned interface{} `json:"pinned"`
|
Pinned interface{} `json:"pinned"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user