diff options
author | Ivanik <ivan170102@gmail.com> | 2021-01-29 04:25:14 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 00:25:14 +0100 |
commit | 8764be74616bde87bbbf6c32901cd9f43264d1e0 (patch) | |
tree | 88902ba17d6a6d245cadb7e0b277bee7ef424f99 /vendor/github.com/SevereCloud/vksdk/v2/object/polls.go | |
parent | 5dd15ef8e716c65accb6cd021095c0e19913d55f (diff) | |
download | matterbridge-msglm-8764be74616bde87bbbf6c32901cd9f43264d1e0.tar.gz matterbridge-msglm-8764be74616bde87bbbf6c32901cd9f43264d1e0.tar.bz2 matterbridge-msglm-8764be74616bde87bbbf6c32901cd9f43264d1e0.zip |
Add vk bridge (#1372)
* Add vk bridge
* Vk bridge attachments
* Vk bridge forwarded messages
* Vk bridge sample config and code cleanup
* Vk bridge add vendor
* Vk bridge message edit
* Vk bridge: fix fetching names of other bots
* Vk bridge: code cleanup
* Vk bridge: fix shadows declaration
* Vk bridge: remove UseFileURL
Diffstat (limited to 'vendor/github.com/SevereCloud/vksdk/v2/object/polls.go')
-rw-r--r-- | vendor/github.com/SevereCloud/vksdk/v2/object/polls.go | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/polls.go b/vendor/github.com/SevereCloud/vksdk/v2/object/polls.go new file mode 100644 index 00000000..a2f69656 --- /dev/null +++ b/vendor/github.com/SevereCloud/vksdk/v2/object/polls.go @@ -0,0 +1,101 @@ +package object // import "github.com/SevereCloud/vksdk/v2/object" + +import ( + "fmt" +) + +// PollsAnswer struct. +type PollsAnswer struct { + ID int `json:"id"` + Rate float64 `json:"rate"` + Text string `json:"text"` + Votes int `json:"votes"` +} + +// PollsPoll struct. +type PollsPoll struct { + AnswerID int `json:"answer_id"` // Current user's answer ID + Answers []PollsAnswer `json:"answers"` + Created int `json:"created"` // Date when poll has been created in Unixtime + ID int `json:"id"` // Poll ID + OwnerID int `json:"owner_id"` // Poll owner's ID + Question string `json:"question"` // Poll question + Votes int `json:"votes"` // Votes number + AnswerIDs []int `json:"answer_ids"` + EndDate int `json:"end_date"` + Anonymous BaseBoolInt `json:"anonymous"` // Information whether the pole is anonymous + Closed BaseBoolInt `json:"closed"` + IsBoard BaseBoolInt `json:"is_board"` + CanEdit BaseBoolInt `json:"can_edit"` + CanVote BaseBoolInt `json:"can_vote"` + CanReport BaseBoolInt `json:"can_report"` + CanShare BaseBoolInt `json:"can_share"` + Multiple BaseBoolInt `json:"multiple"` + DisableUnvote BaseBoolInt `json:"disable_unvote"` + Photo PhotosPhoto `json:"photo"` + AuthorID int `json:"author_id"` + Background PollsBackground `json:"background"` + Friends []PollsFriend `json:"friends"` + Profiles []UsersUser `json:"profiles"` + Groups []GroupsGroup `json:"groups"` +} + +// ToAttachment return attachment format. +func (poll PollsPoll) ToAttachment() string { + return fmt.Sprintf("poll%d_%d", poll.OwnerID, poll.ID) +} + +// PollsFriend struct. +type PollsFriend struct { + ID int `json:"id"` +} + +// PollsVoters struct. +type PollsVoters struct { + AnswerID int `json:"answer_id"` // Answer ID + Users PollsVotersUsers `json:"users"` +} + +// PollsVotersUsers struct. +type PollsVotersUsers struct { + Count int `json:"count"` // Votes number + Items []int `json:"items"` +} + +// PollsVotersFields struct. +type PollsVotersFields struct { + AnswerID int `json:"answer_id"` // Answer ID + Users PollsVotersUsersFields `json:"users"` +} + +// PollsVotersUsersFields struct. +type PollsVotersUsersFields struct { + Count int `json:"count"` // Votes number + Items []UsersUser `json:"items"` +} + +// PollsBackground struct. +type PollsBackground struct { + Type string `json:"type"` + Angle int `json:"angle"` + Color string `json:"color"` + Points []struct { + Position float64 `json:"position"` + Color string `json:"color"` + } `json:"points"` + ID int `json:"id"` + Name string `json:"name"` +} + +// PollsPhoto struct. +type PollsPhoto struct { + ID int `json:"id"` + Color string `json:"color"` + Images []PhotosImage `json:"images"` +} + +// PollsPhotoUploadResponse struct. +type PollsPhotoUploadResponse struct { + Photo string `json:"photo"` // Uploaded photo data + Hash string `json:"hash"` // Uploaded hash +} |