summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/SevereCloud/vksdk/v2/api/polls.go
diff options
context:
space:
mode:
authorIvanik <ivan170102@gmail.com>2021-01-29 04:25:14 +0500
committerGitHub <noreply@github.com>2021-01-29 00:25:14 +0100
commit8764be74616bde87bbbf6c32901cd9f43264d1e0 (patch)
tree88902ba17d6a6d245cadb7e0b277bee7ef424f99 /vendor/github.com/SevereCloud/vksdk/v2/api/polls.go
parent5dd15ef8e716c65accb6cd021095c0e19913d55f (diff)
downloadmatterbridge-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/api/polls.go')
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/polls.go106
1 files changed, 106 insertions, 0 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/polls.go b/vendor/github.com/SevereCloud/vksdk/v2/api/polls.go
new file mode 100644
index 00000000..968b242e
--- /dev/null
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/polls.go
@@ -0,0 +1,106 @@
+package api // import "github.com/SevereCloud/vksdk/v2/api"
+
+import "github.com/SevereCloud/vksdk/v2/object"
+
+// PollsAddVote adds the current user's vote to the selected answer in the poll.
+//
+// https://vk.com/dev/polls.addVote
+func (vk *VK) PollsAddVote(params Params) (response int, err error) {
+ err = vk.RequestUnmarshal("polls.addVote", &response, params)
+ return
+}
+
+// PollsCreateResponse struct.
+type PollsCreateResponse object.PollsPoll
+
+// PollsCreate creates polls that can be attached to the users' or communities' posts.
+//
+// https://vk.com/dev/polls.create
+func (vk *VK) PollsCreate(params Params) (response PollsCreateResponse, err error) {
+ err = vk.RequestUnmarshal("polls.create", &response, params)
+ return
+}
+
+// PollsDeleteVote deletes the current user's vote from the selected answer in the poll.
+//
+// https://vk.com/dev/polls.deleteVote
+func (vk *VK) PollsDeleteVote(params Params) (response int, err error) {
+ err = vk.RequestUnmarshal("polls.deleteVote", &response, params)
+ return
+}
+
+// PollsEdit edits created polls.
+//
+// https://vk.com/dev/polls.edit
+func (vk *VK) PollsEdit(params Params) (response int, err error) {
+ err = vk.RequestUnmarshal("polls.edit", &response, params)
+ return
+}
+
+// PollsGetBackgroundsResponse struct.
+type PollsGetBackgroundsResponse []object.PollsBackground
+
+// PollsGetBackgrounds return default backgrounds for polls.
+//
+// https://vk.com/dev/polls.getBackgrounds
+func (vk *VK) PollsGetBackgrounds(params Params) (response PollsGetBackgroundsResponse, err error) {
+ err = vk.RequestUnmarshal("polls.getBackgrounds", &response, params)
+ return
+}
+
+// PollsGetByIDResponse struct.
+type PollsGetByIDResponse object.PollsPoll
+
+// PollsGetByID returns detailed information about a poll by its ID.
+//
+// https://vk.com/dev/polls.getById
+func (vk *VK) PollsGetByID(params Params) (response PollsGetByIDResponse, err error) {
+ err = vk.RequestUnmarshal("polls.getById", &response, params)
+ return
+}
+
+// PollsGetPhotoUploadServerResponse struct.
+type PollsGetPhotoUploadServerResponse struct {
+ UploadURL string `json:"upload_url"`
+}
+
+// PollsGetPhotoUploadServer returns a URL for uploading a photo to a poll.
+//
+// https://vk.com/dev/polls.getPhotoUploadServer
+func (vk *VK) PollsGetPhotoUploadServer(params Params) (response PollsGetPhotoUploadServerResponse, err error) {
+ err = vk.RequestUnmarshal("polls.getPhotoUploadServer", &response, params)
+ return
+}
+
+// PollsGetVotersResponse struct.
+type PollsGetVotersResponse []object.PollsVoters
+
+// PollsGetVoters returns a list of IDs of users who selected specific answers in the poll.
+//
+// https://vk.com/dev/polls.getVoters
+func (vk *VK) PollsGetVoters(params Params) (response PollsGetVotersResponse, err error) {
+ err = vk.RequestUnmarshal("polls.getVoters", &response, params)
+ return
+}
+
+// PollsGetVotersFieldsResponse struct.
+type PollsGetVotersFieldsResponse []object.PollsVotersFields
+
+// PollsGetVotersFields returns a list of IDs of users who selected specific answers in the poll.
+//
+// https://vk.com/dev/polls.getVoters
+func (vk *VK) PollsGetVotersFields(params Params) (response PollsGetVotersFieldsResponse, err error) {
+ err = vk.RequestUnmarshal("polls.getVoters", &response, params)
+ return
+}
+
+// PollsSavePhotoResponse struct.
+type PollsSavePhotoResponse object.PollsPhoto
+
+// PollsSavePhoto allows to save poll's uploaded photo.
+//
+// https://vk.com/dev/polls.savePhoto
+func (vk *VK) PollsSavePhoto(params Params) (response PollsSavePhotoResponse, err error) {
+ err = vk.RequestUnmarshal("polls.savePhoto", &response, params)
+ return
+}