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/api/users.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/api/users.go')
-rw-r--r-- | vendor/github.com/SevereCloud/vksdk/v2/api/users.go | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/users.go b/vendor/github.com/SevereCloud/vksdk/v2/api/users.go new file mode 100644 index 00000000..2251d562 --- /dev/null +++ b/vendor/github.com/SevereCloud/vksdk/v2/api/users.go @@ -0,0 +1,104 @@ +package api // import "github.com/SevereCloud/vksdk/v2/api" + +import ( + "github.com/SevereCloud/vksdk/v2/object" +) + +// UsersGetResponse users.get response. +type UsersGetResponse []object.UsersUser + +// UsersGet returns detailed information on users. +// +// https://vk.com/dev/users.get +func (vk *VK) UsersGet(params Params) (response UsersGetResponse, err error) { + err = vk.RequestUnmarshal("users.get", &response, params) + return +} + +// UsersGetFollowersResponse struct. +type UsersGetFollowersResponse struct { + Count int `json:"count"` + Items []int `json:"items"` +} + +// UsersGetFollowers returns a list of IDs of followers of the user in +// question, sorted by date added, most recent first. +// +// fields=""; +// +// https://vk.com/dev/users.getFollowers +func (vk *VK) UsersGetFollowers(params Params) (response UsersGetFollowersResponse, err error) { + err = vk.RequestUnmarshal("users.getFollowers", &response, params, Params{"fields": ""}) + + return +} + +// UsersGetFollowersFieldsResponse struct. +type UsersGetFollowersFieldsResponse struct { + Count int `json:"count"` + Items []object.UsersUser `json:"items"` +} + +// UsersGetFollowersFields returns a list of IDs of followers of the user in +// question, sorted by date added, most recent first. +// +// fields not empty. +// +// https://vk.com/dev/users.getFollowers +func (vk *VK) UsersGetFollowersFields(params Params) (response UsersGetFollowersFieldsResponse, err error) { + reqParams := make(Params) + if v, prs := params["fields"]; v == "" || !prs { + reqParams["fields"] = "id" + } + + err = vk.RequestUnmarshal("users.getFollowers", &response, params, reqParams) + + return +} + +// UsersGetSubscriptionsResponse struct. +type UsersGetSubscriptionsResponse struct { + Users struct { + Count int `json:"count"` + Items []int `json:"items"` + } `json:"users"` + Groups struct { + Count int `json:"count"` + Items []int `json:"items"` + } `json:"groups"` +} + +// UsersGetSubscriptions returns a list of IDs of users and public pages followed by the user. +// +// extended=0 +// +// https://vk.com/dev/users.getSubscriptions +// +// BUG(SevereCloud): UsersGetSubscriptions bad response with extended=1. +func (vk *VK) UsersGetSubscriptions(params Params) (response UsersGetSubscriptionsResponse, err error) { + err = vk.RequestUnmarshal("users.getSubscriptions", &response, params, Params{"extended": false}) + + return +} + +// UsersReport reports (submits a complain about) a user. +// +// https://vk.com/dev/users.report +func (vk *VK) UsersReport(params Params) (response int, err error) { + err = vk.RequestUnmarshal("users.report", &response, params) + return +} + +// UsersSearchResponse struct. +type UsersSearchResponse struct { + Count int `json:"count"` + Items []object.UsersUser `json:"items"` +} + +// UsersSearch returns a list of users matching the search criteria. +// +// https://vk.com/dev/users.search +func (vk *VK) UsersSearch(params Params) (response UsersSearchResponse, err error) { + err = vk.RequestUnmarshal("users.search", &response, params) + return +} |