summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/SevereCloud
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2022-01-28 23:48:40 +0100
committerGitHub <noreply@github.com>2022-01-28 23:48:40 +0100
commit5a1fd7daddbb07b93e3611d023ea48e1991fc0c6 (patch)
treee592a99163702c4c6214c9519a7983fa58fab13c /vendor/github.com/SevereCloud
parentac06a268096285a9f795bd19df950075a930c9d6 (diff)
downloadmatterbridge-msglm-5a1fd7daddbb07b93e3611d023ea48e1991fc0c6.tar.gz
matterbridge-msglm-5a1fd7daddbb07b93e3611d023ea48e1991fc0c6.tar.bz2
matterbridge-msglm-5a1fd7daddbb07b93e3611d023ea48e1991fc0c6.zip
Bump github.com/SevereCloud/vksdk/v2 from 2.11.0 to 2.13.0 (#1698)
Bumps [github.com/SevereCloud/vksdk/v2](https://github.com/SevereCloud/vksdk) from 2.11.0 to 2.13.0. - [Release notes](https://github.com/SevereCloud/vksdk/releases) - [Commits](https://github.com/SevereCloud/vksdk/compare/v2.11.0...v2.13.0) --- updated-dependencies: - dependency-name: github.com/SevereCloud/vksdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/SevereCloud')
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml2
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/.markdownlint.yml1
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/CONTRIBUTING.md2
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/README.md7
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/README.md50
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/ads.go21
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/api.go92
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/auth.go59
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/errors.go34
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/execute.go23
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/market.go1
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/messages.go26
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/photos.go13
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/api/utils.go36
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/doc.go2
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/README.md2
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/longpoll.go58
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/account.go34
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/ads.go20
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/apps.go3
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/auth.go17
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/database.go6
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/groups.go325
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/market.go63
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/messages.go42
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/notifications.go6
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/object.go71
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/photos.go1
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/raw.go39
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/stories.go2
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/users.go33
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/utils.go60
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/video.go70
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/wall.go23
-rw-r--r--vendor/github.com/SevereCloud/vksdk/v2/object/widgets.go3
35 files changed, 1062 insertions, 185 deletions
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml b/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml
index cb8abdca..a21475f1 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml
+++ b/vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml
@@ -53,10 +53,10 @@ linters:
- ireturn
- nilnil
- tenv
+ - nestif
# - wrapcheck # TODO: v3 Fix
# - testpackage # TODO: Fix testpackage
-# - nestif # TODO: Fix nestif
# - noctx # TODO: Fix noctx
# don't enable:
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/.markdownlint.yml b/vendor/github.com/SevereCloud/vksdk/v2/.markdownlint.yml
index 436de161..07eb66b6 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/.markdownlint.yml
+++ b/vendor/github.com/SevereCloud/vksdk/v2/.markdownlint.yml
@@ -1,2 +1,3 @@
---
no-hard-tabs: false
+no-duplicate-heading: false
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/CONTRIBUTING.md b/vendor/github.com/SevereCloud/vksdk/v2/CONTRIBUTING.md
index 7606cad8..76043620 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/CONTRIBUTING.md
+++ b/vendor/github.com/SevereCloud/vksdk/v2/CONTRIBUTING.md
@@ -6,7 +6,7 @@
Требования:
-- [Go 1.13+](https://golang.org/doc/install)
+- [Go 1.16+](https://golang.org/doc/install)
- [golangci-lint](https://github.com/golangci/golangci-lint)
- [global .gitignore](https://help.github.com/en/articles/ignoring-files#create-a-global-gitignore)
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/README.md b/vendor/github.com/SevereCloud/vksdk/v2/README.md
index 60e89dd4..580f6a95 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/README.md
+++ b/vendor/github.com/SevereCloud/vksdk/v2/README.md
@@ -16,11 +16,13 @@
Version API 5.131.
- [API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api)
- - 400+ methods
- - Ability to change the request handler
+ - 500+ methods
- Ability to modify HTTP client
- Request Limiter
+ - Support [zstd](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api#VK.EnableZstd)
+and [MessagePack](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api#VK.EnableMessagePack)
- Token pool
+ - [OAuth](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api/oauth)
- [Callback API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/callback)
- Tracking tool for users activity in your VK communities
- Supports all events
@@ -60,6 +62,7 @@ go get github.com/SevereCloud/vksdk/v2@latest
## Use by
+- A simple chat bridge: <https://github.com/42wim/matterbridge>
- [Joe](https://github.com/go-joe/joe) adapter: <https://github.com/tdakkota/joe-vk-adapter>
- [Logrus](https://github.com/sirupsen/logrus) hook: <https://github.com/SevereCloud/vkrus>
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/README.md b/vendor/github.com/SevereCloud/vksdk/v2/api/README.md
index 770ab025..5d2d0c76 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/README.md
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/README.md
@@ -3,7 +3,7 @@
[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v2/api)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api)
[![VK](https://img.shields.io/badge/developers-%234a76a8.svg?logo=VK&logoColor=white)](https://vk.com/dev/first_guide)
-Данная библиотека поддерживает версию API **5.122**.
+Данная библиотека поддерживает версию API **5.131**.
## Запросы
@@ -80,6 +80,54 @@ if errors.As(err, &e) {
Для Execute существует отдельная ошибка `ExecuteErrors`
+### Поддержка MessagePack и zstd
+
+> Результат перехода с gzip (JSON) на zstd (msgpack):
+>
+> - в 7 раз быстрее сжатие (–1 мкс);
+> - на 10% меньше размер данных (8 Кбайт вместо 9 Кбайт);
+> - продуктовый эффект не статзначимый :(
+>
+> [Как мы отказались от JPEG, JSON, TCP и ускорили ВКонтакте в два раза](https://habr.com/ru/company/vk/blog/594633/)
+
+VK API способно возвращать ответ в виде [MessagePack](https://msgpack.org/).
+Это эффективный формат двоичной сериализации, похожий на JSON, только быстрее
+и меньше по размеру.
+
+ВНИМАНИЕ, C MessagePack НЕКОТОРЫЕ МЕТОДЫ МОГУТ ВОЗВРАЩАТЬ
+СЛОМАННУЮ КОДИРОВКУ.
+
+Для сжатия, вместо классического gzip, можно использовать
+[zstd](https://github.com/facebook/zstd). Сейчас vksdk поддерживает zstd без
+словаря. Если кто знает как получать словарь,
+[отпишитесь сюда](https://github.com/SevereCloud/vksdk/issues/180).
+
+```go
+vk := api.NewVK(os.Getenv("USER_TOKEN"))
+
+method := "store.getStickersKeywords"
+params := api.Params{
+ "aliases": true,
+ "all_products": true,
+ "need_stickers": true,
+}
+
+r, err := vk.Request(method, params) // Content-Length: 44758
+if err != nil {
+ log.Fatal(err)
+}
+log.Println("json:", len(r)) // json: 814231
+
+vk.EnableMessagePack() // Включаем поддержку MessagePack
+vk.EnableZstd() // Включаем поддержку zstd
+
+r, err = vk.Request(method, params) // Content-Length: 35755
+if err != nil {
+ log.Fatal(err)
+}
+log.Println("msgpack:", len(r)) // msgpack: 650775
+```
+
### Запрос любого метода
Пример запроса [users.get](https://vk.com/dev/users.get)
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/ads.go b/vendor/github.com/SevereCloud/vksdk/v2/api/ads.go
index 529e1be4..544143b3 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/ads.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/ads.go
@@ -1,9 +1,11 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
import (
+ "bytes"
"encoding/json"
"github.com/SevereCloud/vksdk/v2/object"
+ "github.com/vmihailenco/msgpack/v5"
)
// AdsAddOfficeUsersItem struct.
@@ -21,6 +23,23 @@ func (r *AdsAddOfficeUsersItem) UnmarshalJSON(data []byte) (err error) {
return
}
+// DecodeMsgpack func.
+func (r *AdsAddOfficeUsersItem) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ if msgpack.Unmarshal(data, &r.OK) != nil {
+ d := msgpack.NewDecoder(bytes.NewReader(data))
+ d.SetCustomStructTag("json")
+
+ return d.Decode(&r.Error)
+ }
+
+ return nil
+}
+
// AdsAddOfficeUsersResponse struct.
type AdsAddOfficeUsersResponse []AdsAddOfficeUsersItem
@@ -349,7 +368,7 @@ func (vk *VK) AdsGetAdsLayout(params Params) (response AdsGetAdsLayoutResponse,
// AdsGetMusiciansResponse struct.
type AdsGetMusiciansResponse struct {
- Items []object.BaseObjectWithName
+ Items []object.AdsMusician
}
// AdsGetMusicians returns a list of musicians.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/api.go b/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
index 56da7784..760bc7e0 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/api.go
@@ -7,9 +7,11 @@ package api // import "github.com/SevereCloud/vksdk/v2/api"
import (
"bytes"
+ "compress/gzip"
"context"
"encoding/json"
"fmt"
+ "io"
"mime"
"net/http"
"net/url"
@@ -21,6 +23,8 @@ import (
"github.com/SevereCloud/vksdk/v2"
"github.com/SevereCloud/vksdk/v2/internal"
"github.com/SevereCloud/vksdk/v2/object"
+ "github.com/klauspost/compress/zstd"
+ "github.com/vmihailenco/msgpack/v5"
)
// Api constants.
@@ -91,6 +95,9 @@ type VK struct {
UserAgent string
Handler func(method string, params ...Params) (Response, error)
+ msgpack bool
+ zstd bool
+
mux sync.Mutex
lastTime time.Time
rps int
@@ -98,9 +105,9 @@ type VK struct {
// Response struct.
type Response struct {
- Response json.RawMessage `json:"response"`
- Error Error `json:"error"`
- ExecuteErrors ExecuteErrors `json:"execute_errors"`
+ Response object.RawMessage `json:"response"`
+ Error Error `json:"error"`
+ ExecuteErrors ExecuteErrors `json:"execute_errors"`
}
// NewVK returns a new VK.
@@ -121,7 +128,7 @@ func NewVK(tokens ...string) *VK {
vk.accessTokens = tokens
vk.Version = Version
- vk.Handler = vk.defaultHandler
+ vk.Handler = vk.DefaultHandler
vk.MethodURL = MethodURL
vk.Client = http.DefaultClient
@@ -207,8 +214,8 @@ func buildQuery(sliceParams ...Params) (context.Context, url.Values) {
return ctx, query
}
-// defaultHandler provides access to VK API methods.
-func (vk *VK) defaultHandler(method string, sliceParams ...Params) (Response, error) {
+// DefaultHandler provides access to VK API methods.
+func (vk *VK) DefaultHandler(method string, sliceParams ...Params) (Response, error) {
u := vk.MethodURL + method
ctx, query := buildQuery(sliceParams...)
attempt := 0
@@ -243,24 +250,52 @@ func (vk *VK) defaultHandler(method string, sliceParams ...Params) (Response, er
return response, err
}
+ acceptEncoding := "gzip"
+ if vk.zstd {
+ acceptEncoding = "zstd"
+ }
+
req.Header.Set("User-Agent", vk.UserAgent)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ req.Header.Set("Accept-Encoding", acceptEncoding)
+
+ var reader io.Reader
+
resp, err := vk.Client.Do(req)
if err != nil {
return response, err
}
- mediatype, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
- if mediatype != "application/json" {
- _ = resp.Body.Close()
- return response, &InvalidContentType{mediatype}
+ switch resp.Header.Get("Content-Encoding") {
+ case "zstd":
+ reader, _ = zstd.NewReader(resp.Body)
+ case "gzip":
+ reader, _ = gzip.NewReader(resp.Body)
+ default:
+ reader = resp.Body
}
- err = json.NewDecoder(resp.Body).Decode(&response)
- if err != nil {
+ mediatype, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
+ switch mediatype {
+ case "application/json":
+ err = json.NewDecoder(reader).Decode(&response)
+ if err != nil {
+ _ = resp.Body.Close()
+ return response, err
+ }
+ case "application/x-msgpack":
+ dec := msgpack.NewDecoder(reader)
+ dec.SetCustomStructTag("json")
+
+ err = dec.Decode(&response)
+ if err != nil {
+ _ = resp.Body.Close()
+ return response, err
+ }
+ default:
_ = resp.Body.Close()
- return response, err
+ return response, &InvalidContentType{mediatype}
}
_ = resp.Body.Close()
@@ -291,6 +326,10 @@ func (vk *VK) Request(method string, sliceParams ...Params) ([]byte, error) {
sliceParams = append(sliceParams, reqParams)
+ if vk.msgpack {
+ method += ".msgpack"
+ }
+
resp, err := vk.Handler(method, sliceParams...)
return resp.Response, err
@@ -303,7 +342,32 @@ func (vk *VK) RequestUnmarshal(method string, obj interface{}, sliceParams ...Pa
return err
}
- return json.Unmarshal(rawResponse, &obj)
+ if vk.msgpack {
+ dec := msgpack.NewDecoder(bytes.NewReader(rawResponse))
+ dec.SetCustomStructTag("json")
+
+ err = dec.Decode(&obj)
+ } else {
+ err = json.Unmarshal(rawResponse, &obj)
+ }
+
+ return err
+}
+
+// EnableMessagePack enable using MessagePack instead of JSON.
+//
+// THIS IS EXPERIMENTAL FUNCTION! Broken encoding returned in some methods.
+//
+// See https://msgpack.org
+func (vk *VK) EnableMessagePack() {
+ vk.msgpack = true
+}
+
+// EnableZstd enable using zstd instead of gzip.
+//
+// This not use dict.
+func (vk *VK) EnableZstd() {
+ vk.zstd = true
}
func fmtReflectValue(value reflect.Value, depth int) string {
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/auth.go b/vendor/github.com/SevereCloud/vksdk/v2/api/auth.go
index f927a6ff..62a08c07 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/auth.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/auth.go
@@ -1,5 +1,9 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
+import (
+ "github.com/SevereCloud/vksdk/v2/object"
+)
+
// AuthCheckPhone checks a user's phone number for correctness.
//
// https://vk.com/dev/auth.checkPhone
@@ -24,3 +28,58 @@ func (vk *VK) AuthRestore(params Params) (response AuthRestoreResponse, err erro
err = vk.RequestUnmarshal("auth.restore", &response, params)
return
}
+
+// AuthGetProfileInfoBySilentTokenResponse struct.
+type AuthGetProfileInfoBySilentTokenResponse struct {
+ Success []object.AuthSilentTokenProfile `json:"success"`
+ Errors []AuthSilentTokenError `json:"errors"`
+}
+
+// AuthGetProfileInfoBySilentToken method.
+//
+// https://platform.vk.com/?p=DocsDashboard&docs=tokens_silent-token
+func (vk *VK) AuthGetProfileInfoBySilentToken(params Params) (response AuthGetProfileInfoBySilentTokenResponse, err error) {
+ err = vk.RequestUnmarshal("auth.getProfileInfoBySilentToken", &response, params)
+ return
+}
+
+// ExchangeSilentTokenSource call conditions exchangeSilentToken.
+//
+// 0 Unknown
+// 1 Silent authentication
+// 2 Auth by login and password
+// 3 Extended registration
+// 4 Auth by exchange token
+// 5 Auth by exchange token on reset password
+// 6 Auth by exchange token on unblock
+// 7 Auth by exchange token on reset session
+// 8 Auth by exchange token on change password
+// 9 Finish phone validation on authentication
+// 10 Auth by code
+// 11 Auth by external oauth
+// 12 Reactivation
+// 15 Auth by SDK temporary access-token
+type ExchangeSilentTokenSource int
+
+// AuthExchangeSilentAuthTokenResponse struct.
+type AuthExchangeSilentAuthTokenResponse struct {
+ AccessToken string `json:"access_token"`
+ AccessTokenID string `json:"access_token_id"`
+ UserID int `json:"user_id"`
+ Phone string `json:"phone"`
+ PhoneValidated interface{} `json:"phone_validated"`
+ IsPartial bool `json:"is_partial"`
+ IsService bool `json:"is_service"`
+ AdditionalSignupRequired bool `json:"additional_signup_required"`
+ Email string `json:"email"`
+ Source ExchangeSilentTokenSource `json:"source"`
+ SourceDescription string `json:"source_description"`
+}
+
+// AuthExchangeSilentAuthToken method.
+//
+// https://platform.vk.com/?p=DocsDashboard&docs=tokens_access-token
+func (vk *VK) AuthExchangeSilentAuthToken(params Params) (response AuthExchangeSilentAuthTokenResponse, err error) {
+ err = vk.RequestUnmarshal("auth.exchangeSilentAuthToken", &response, params)
+ return
+}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/errors.go b/vendor/github.com/SevereCloud/vksdk/v2/api/errors.go
index 03032aa6..aa6ea509 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/errors.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/errors.go
@@ -598,6 +598,12 @@ const (
// This user can't be added to the work chat, as they aren't an employe.
ErrMessagesAccessWorkChat ErrorType = 967
+ // Message cannot be forwarded.
+ ErrMessagesCantForwarded ErrorType = 969
+
+ // Cannot pin an expiring message.
+ ErrMessagesPinExpiringMessage ErrorType = 970
+
// Invalid phone number.
ErrParamPhone ErrorType = 1000
@@ -994,3 +1000,31 @@ func (e AdsError) Is(target error) bool {
return false
}
+
+// AuthSilentTokenError struct.
+type AuthSilentTokenError struct {
+ Token string `json:"token"`
+ Code ErrorType `json:"code"`
+ Description string `json:"description"`
+}
+
+// Error returns the description of a AuthSilentTokenError.
+func (e AuthSilentTokenError) Error() string {
+ return "api: " + e.Description
+}
+
+// Is unwraps its first argument sequentially looking for an error that matches
+// the second.
+func (e AuthSilentTokenError) Is(target error) bool {
+ var tError *AuthSilentTokenError
+ if errors.As(target, &tError) {
+ return e.Code == tError.Code && e.Description == tError.Description
+ }
+
+ var tErrorType ErrorType
+ if errors.As(target, &tErrorType) {
+ return e.Code == tErrorType
+ }
+
+ return false
+}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go b/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go
index cc52cd0d..1ee04cee 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/execute.go
@@ -1,6 +1,11 @@
package api
-import "encoding/json"
+import (
+ "bytes"
+ "encoding/json"
+
+ "github.com/vmihailenco/msgpack/v5"
+)
// ExecuteWithArgs a universal method for calling a sequence of other methods
// while saving and filtering interim results.
@@ -26,9 +31,19 @@ func (vk *VK) ExecuteWithArgs(code string, params Params, obj interface{}) error
return err
}
- jsonErr := json.Unmarshal(resp.Response, &obj)
- if jsonErr != nil {
- return jsonErr
+ var decoderErr error
+
+ if vk.msgpack {
+ dec := msgpack.NewDecoder(bytes.NewReader(resp.Response))
+ dec.SetCustomStructTag("json")
+
+ decoderErr = dec.Decode(&obj)
+ } else {
+ decoderErr = json.Unmarshal(resp.Response, &obj)
+ }
+
+ if decoderErr != nil {
+ return decoderErr
}
if resp.ExecuteErrors != nil {
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/market.go b/vendor/github.com/SevereCloud/vksdk/v2/api/market.go
index 0bb35687..6b823818 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/market.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/market.go
@@ -20,6 +20,7 @@ func (vk *VK) MarketAdd(params Params) (response MarketAddResponse, err error) {
// MarketAddAlbumResponse struct.
type MarketAddAlbumResponse struct {
MarketAlbumID int `json:"market_album_id"` // Album ID
+ AlbumsCount int `json:"albums_count"`
}
// MarketAddAlbum creates new collection of items.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/messages.go b/vendor/github.com/SevereCloud/vksdk/v2/api/messages.go
index 0a8f5613..a74266fe 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/messages.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/messages.go
@@ -1,7 +1,10 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
import (
+ "strconv"
+
"github.com/SevereCloud/vksdk/v2/object"
+ "github.com/vmihailenco/msgpack/v5"
)
// MessagesAddChatUser adds a new user to a chat.
@@ -31,11 +34,34 @@ func (vk *VK) MessagesCreateChat(params Params) (response int, err error) {
// MessagesDeleteResponse struct.
type MessagesDeleteResponse map[string]int
+// DecodeMsgpack funcion.
+func (resp *MessagesDeleteResponse) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ var respMap map[int]int
+
+ err = msgpack.Unmarshal(data, &respMap)
+ if err != nil {
+ return err
+ }
+
+ *resp = make(MessagesDeleteResponse)
+ for key, val := range respMap {
+ (*resp)[strconv.Itoa(key)] = val
+ }
+
+ return nil
+}
+
// MessagesDelete deletes one or more messages.
//
// https://vk.com/dev/messages.delete
func (vk *VK) MessagesDelete(params Params) (response MessagesDeleteResponse, err error) {
err = vk.RequestUnmarshal("messages.delete", &response, params)
+
return
}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/photos.go b/vendor/github.com/SevereCloud/vksdk/v2/api/photos.go
index 714705b4..d52cbeed 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/photos.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/photos.go
@@ -571,12 +571,13 @@ func (vk *VK) PhotosSaveOwnerCoverPhoto(params Params) (response PhotosSaveOwner
// PhotosSaveOwnerPhotoResponse struct.
type PhotosSaveOwnerPhotoResponse struct {
- PhotoHash string `json:"photo_hash"`
- PhotoSrc string `json:"photo_src"`
- PhotoSrcBig string `json:"photo_src_big"`
- PhotoSrcSmall string `json:"photo_src_small"`
- Saved int `json:"saved"`
- PostID int `json:"post_id"`
+ PhotoHash string `json:"photo_hash"`
+ // BUG(VK): returns false
+ // PhotoSrc string `json:"photo_src"`
+ // PhotoSrcBig string `json:"photo_src_big"`
+ // PhotoSrcSmall string `json:"photo_src_small"`
+ Saved int `json:"saved"`
+ PostID int `json:"post_id"`
}
// PhotosSaveOwnerPhoto saves a profile or community photo.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/api/utils.go b/vendor/github.com/SevereCloud/vksdk/v2/api/utils.go
index 63508fe2..965c26f2 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/api/utils.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/api/utils.go
@@ -1,9 +1,8 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
import (
- "encoding/json"
-
"github.com/SevereCloud/vksdk/v2/object"
+ "github.com/vmihailenco/msgpack/v5"
)
// UtilsCheckLinkResponse struct.
@@ -89,17 +88,34 @@ func (vk *VK) UtilsGetShortLink(params Params) (response UtilsGetShortLinkRespon
// UtilsResolveScreenNameResponse struct.
type UtilsResolveScreenNameResponse object.UtilsDomainResolved
+// UnmarshalJSON UtilsResolveScreenNameResponse.
+//
+// BUG(VK): UtilsResolveScreenNameResponse return [].
+func (resp *UtilsResolveScreenNameResponse) UnmarshalJSON(data []byte) error {
+ var p object.UtilsDomainResolved
+ err := p.UnmarshalJSON(data)
+
+ *resp = UtilsResolveScreenNameResponse(p)
+
+ return err
+}
+
+// DecodeMsgpack UtilsResolveScreenNameResponse.
+//
+// BUG(VK): UtilsResolveScreenNameResponse return [].
+func (resp *UtilsResolveScreenNameResponse) DecodeMsgpack(dec *msgpack.Decoder) error {
+ var p object.UtilsDomainResolved
+ err := p.DecodeMsgpack(dec)
+
+ *resp = UtilsResolveScreenNameResponse(p)
+
+ return err
+}
+
// UtilsResolveScreenName detects a type of object (e.g., user, community, application) and its ID by screen name.
//
// https://vk.com/dev/utils.resolveScreenName
func (vk *VK) UtilsResolveScreenName(params Params) (response UtilsResolveScreenNameResponse, err error) {
- rawResponse, err := vk.Request("utils.resolveScreenName", params)
- // Если короткое имя screen_name не занято, то будет возвращён пустой объект.
- if err != nil || string(rawResponse) == "[]" {
- return
- }
-
- err = json.Unmarshal(rawResponse, &response)
-
+ err = vk.RequestUnmarshal("utils.resolveScreenName", &response, params)
return
}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/doc.go b/vendor/github.com/SevereCloud/vksdk/v2/doc.go
index 61e19efe..ff749d80 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/doc.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/doc.go
@@ -7,6 +7,6 @@ package vksdk
// Module constants.
const (
- Version = "2.11.0"
+ Version = "2.13.0"
API = "5.131"
)
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/README.md b/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/README.md
index 94d87dba..8d8be2a0 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/README.md
+++ b/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/README.md
@@ -10,7 +10,7 @@ Long Poll настраивается автоматически. Вам не т
### Версия API
-Данная библиотека поддерживает версию API **5.122**.
+Данная библиотека поддерживает версию API **5.131**.
### Инициализация
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/longpoll.go b/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/longpoll.go
index c4a3efec..6cde105a 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/longpoll.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/longpoll-bot/longpoll.go
@@ -8,8 +8,11 @@ package longpoll // import "github.com/SevereCloud/vksdk/v2/longpoll-bot"
import (
"context"
"encoding/json"
+ "errors"
"fmt"
+ "io"
"net/http"
+ "strconv"
"github.com/SevereCloud/vksdk/v2"
"github.com/SevereCloud/vksdk/v2/api"
@@ -117,7 +120,7 @@ func (lp *LongPoll) check(ctx context.Context) (response Response, err error) {
}
defer resp.Body.Close()
- err = json.NewDecoder(resp.Body).Decode(&response)
+ response, err = parseResponse(resp.Body)
if err != nil {
return response, err
}
@@ -127,6 +130,59 @@ func (lp *LongPoll) check(ctx context.Context) (response Response, err error) {
return response, err
}
+func parseResponse(reader io.Reader) (response Response, err error) {
+ decoder := json.NewDecoder(reader)
+ for decoder.More() {
+ token, err := decoder.Token()
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ break
+ }
+
+ return response, err
+ }
+
+ t, ok := token.(string)
+ if !ok {
+ continue
+ }
+
+ switch t {
+ case "failed":
+ raw, err := decoder.Token()
+ if err != nil {
+ return response, err
+ }
+
+ response.Failed = int(raw.(float64))
+ case "updates":
+ var updates []events.GroupEvent
+
+ err = decoder.Decode(&updates)
+ if err != nil {
+ return response, err
+ }
+
+ response.Updates = updates
+ case "ts":
+ // can be a number in the response with "failed" field: {"ts":8,"failed":1}
+ // or string, e.g. {"ts":"8","updates":[]}
+ rawTs, err := decoder.Token()
+ if err != nil {
+ return response, err
+ }
+
+ if ts, isNumber := rawTs.(float64); isNumber {
+ response.Ts = strconv.Itoa(int(ts))
+ } else {
+ response.Ts = rawTs.(string)
+ }
+ }
+ }
+
+ return response, err
+}
+
func (lp *LongPoll) checkResponse(response Response) (err error) {
switch response.Failed {
case 0:
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/account.go b/vendor/github.com/SevereCloud/vksdk/v2/object/account.go
index 82247745..ca04dce1 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/account.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/account.go
@@ -62,21 +62,24 @@ type AccountOffer struct {
// AccountAccountCounters struct.
type AccountAccountCounters struct {
- AppRequests int `json:"app_requests"` // New app requests number
- Events int `json:"events"` // New events number
- Friends int `json:"friends"` // New friends requests number
- FriendsRecommendations int `json:"friends_recommendations"` // New friends recommendations number
- FriendsSuggestions int `json:"friends_suggestions"` // New friends suggestions number
- Gifts int `json:"gifts"` // New gifts number
- Groups int `json:"groups"` // New groups number
- Messages int `json:"messages"` // New messages number
- Notifications int `json:"notifications"` // New notifications number
- Photos int `json:"photos"` // New photo tags number
- SDK int `json:"sdk"` // New SDK number
- MenuDiscoverBadge int `json:"menu_discover_badge"` // New menu discover badge number
- MenuClipsBadge int `json:"menu_clips_badge"` // New menu clips badge number
- Videos int `json:"videos"` // New video tags number
- Faves int `json:"faves"` // New faves number
+ AppRequests int `json:"app_requests"` // New app requests number
+ Events int `json:"events"` // New events number
+ Friends int `json:"friends"` // New friends requests number
+ FriendsRecommendations int `json:"friends_recommendations"` // New friends recommendations number
+ FriendsSuggestions int `json:"friends_suggestions"` // New friends suggestions number
+ Gifts int `json:"gifts"` // New gifts number
+ Groups int `json:"groups"` // New groups number
+ Messages int `json:"messages"` // New messages number
+ Notifications int `json:"notifications"` // New notifications number
+ Photos int `json:"photos"` // New photo tags number
+ SDK int `json:"sdk"` // New SDK number
+ MenuDiscoverBadge int `json:"menu_discover_badge"` // New menu discover badge number
+ MenuClipsBadge int `json:"menu_clips_badge"` // New menu clips badge number
+ Videos int `json:"videos"` // New video tags number
+ Faves int `json:"faves"` // New faves number
+ Calls int `json:"calls"` // New calls number
+ MenuSuperappFriendsBadge int `json:"menu_superapp_friends_badge"`
+ MenuNewClipsBadge int `json:"menu_new_clips_badge"`
}
// AccountInfo struct.
@@ -107,6 +110,7 @@ type AccountInfo struct {
IsLiveStreamingEnabled BaseBoolInt `json:"is_live_streaming_enabled"`
IsNewLiveStreamingEnabled BaseBoolInt `json:"is_new_live_streaming_enabled"`
LinkRedirects map[string]string `json:"link_redirects"`
+ VkPayEndpointV2 string `json:"vk_pay_endpoint_v2"`
}
// AccountPushSettings struct.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/ads.go b/vendor/github.com/SevereCloud/vksdk/v2/object/ads.go
index e0c379b4..a946c6e3 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/ads.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/ads.go
@@ -8,12 +8,13 @@ type AdsAccesses struct {
// AdsAccount struct.
type AdsAccount struct {
- AccessRole string `json:"access_role"`
- AccountID int `json:"account_id"` // Account ID
- AccountName string `json:"account_name"`
- AccountStatus BaseBoolInt `json:"account_status"` // Information whether account is active
- CanViewBudget BaseBoolInt `json:"can_view_budget"`
- AccountType string `json:"account_type"`
+ AccessRole string `json:"access_role"`
+ AccountID int `json:"account_id"` // Account ID
+ AccountName string `json:"account_name"`
+ AccountStatus BaseBoolInt `json:"account_status"` // Information whether account is active
+ CanViewBudget BaseBoolInt `json:"can_view_budget"`
+ AdNetworkAllowedPotentially BaseBoolInt `json:"ad_network_allowed_potentially"`
+ AccountType string `json:"account_type"`
}
// AdsAdLayout struct.
@@ -318,3 +319,10 @@ type AdsPromotedPostReach struct {
VideoViews75p int `json:"video_views_75p"` // Video views for 75 percent
VideoViewsStart int `json:"video_views_start"` // Video starts
}
+
+// AdsMusician struct.
+type AdsMusician struct {
+ ID int `json:"id"` // Targeting music artist ID
+ Name string `json:"name"` // Music artist name
+ Avatar string `json:"avatar,omitempty"` // Music artist photo.
+}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/apps.go b/vendor/github.com/SevereCloud/vksdk/v2/object/apps.go
index aaf4bbdb..c7036397 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/apps.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/apps.go
@@ -60,6 +60,7 @@ type AppsApp struct {
IsNew BaseBoolInt `json:"is_new"`
New BaseBoolInt `json:"new"`
IsInstalled BaseBoolInt `json:"is_installed"`
+ HasVkConnect BaseBoolInt `json:"has_vk_connect"`
LeaderboardType int `json:"leaderboard_type"`
MembersCount int `json:"members_count"` // Members number
PlatformID int `json:"platform_id"` // Application ID in store
@@ -78,7 +79,7 @@ type AppsApp struct {
// mobile_controls_type = 0 - прозрачный элемент управления поверх области с игрой;
// mobile_controls_type = 1 - чёрная полоска над областью с игрой;
- // mobile_controls_type = 2 - только для vk apps, без контроллов.
+ // mobile_controls_type = 2 - только для vk apps, без элементов управления'.
MobileControlsType int `json:"mobile_controls_type"`
// mobile_view_support_type = 0 - игра не использует нижнюю часть экрана на iPhoneX, черная полоса есть.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/auth.go b/vendor/github.com/SevereCloud/vksdk/v2/object/auth.go
new file mode 100644
index 00000000..78b3e10c
--- /dev/null
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/auth.go
@@ -0,0 +1,17 @@
+package object // import "github.com/SevereCloud/vksdk/v2/object"
+
+// AuthSilentTokenProfile struct.
+type AuthSilentTokenProfile struct {
+ Token string `json:"token"`
+ Expires int `json:"expires"`
+ FirstName string `json:"first_name"`
+ LastName string `json:"last_name"`
+ Photo50 string `json:"photo_50"`
+ Photo100 string `json:"photo_100"`
+ Photo200 string `json:"photo_200"`
+ Phone string `json:"phone"`
+ PhoneValidated interface{} `json:"phone_validated"` // int | bool
+ UserID int `json:"user_id"`
+ IsPartial BaseBoolInt `json:"is_partial"`
+ IsService BaseBoolInt `json:"is_service"`
+}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/database.go b/vendor/github.com/SevereCloud/vksdk/v2/object/database.go
index e8cd9341..5db2b949 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/database.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/database.go
@@ -4,9 +4,9 @@ package object // import "github.com/SevereCloud/vksdk/v2/object"
type DatabaseCity struct {
ID int `json:"id"` // City ID
Title string `json:"title"` // City title
- Area string `json:"area"`
- Region string `json:"region"`
- Important BaseBoolInt `json:"important"`
+ Area string `json:"area,omitempty"`
+ Region string `json:"region,omitempty"`
+ Important BaseBoolInt `json:"important,omitempty"`
}
// DatabaseMetroStation struct.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go b/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go
index d1f31e95..6cabae01 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/groups.go
@@ -1,9 +1,13 @@
package object // import "github.com/SevereCloud/vksdk/v2/object"
import (
+ "bytes"
"encoding/json"
"fmt"
"reflect"
+
+ "github.com/vmihailenco/msgpack/v5"
+ "github.com/vmihailenco/msgpack/v5/msgpcode"
)
// GroupsAddress WorkInfoStatus of information about timetable.
@@ -110,112 +114,113 @@ const (
// GroupsGroup struct.
type GroupsGroup struct {
- AdminLevel int `json:"admin_level"`
- Deactivated string `json:"deactivated"` // Information whether community is banned
- FinishDate int `json:"finish_date"` // Finish date in Unixtime format
ID int `json:"id"` // Community ID
Name string `json:"name"` // Community name
- Photo100 string `json:"photo_100"` // URL of square photo of the community with 100 pixels in width
- Photo200 string `json:"photo_200"` // URL of square photo of the community with 200 pixels in width
- Photo50 string `json:"photo_50"` // URL of square photo of the community with 50 pixels in width
ScreenName string `json:"screen_name"` // Domain of the community page
- StartDate int `json:"start_date"` // Start date in Unixtime format
Type string `json:"type"`
- Market GroupsMarketInfo `json:"market"`
- MemberStatus int `json:"member_status"` // Current user's member status
IsClosed int `json:"is_closed"`
- City BaseObject `json:"city"`
- Country BaseCountry `json:"country"`
+ AdminLevel int `json:"admin_level,omitempty"`
+ Deactivated string `json:"deactivated,omitempty"` // Information whether community is banned
+ FinishDate int `json:"finish_date,omitempty"` // Finish date in Unixtime format
+ Photo100 string `json:"photo_100,omitempty"` // URL of square photo of the community with 100 pixels in width
+ Photo200 string `json:"photo_200,omitempty"` // URL of square photo of the community with 200 pixels in width
+ Photo50 string `json:"photo_50,omitempty"` // URL of square photo of the community with 50 pixels in width
+ StartDate int `json:"start_date,omitempty"` // Start date in Unixtime format
+ Market GroupsMarketInfo `json:"market,omitempty"`
+ MemberStatus int `json:"member_status,omitempty"` // Current user's member status
+ City BaseObject `json:"city,omitempty"`
+ Country BaseCountry `json:"country,omitempty"`
// Information whether current user is administrator.
IsAdmin BaseBoolInt `json:"is_admin"`
// Information whether current user is advertiser.
- IsAdvertiser BaseBoolInt `json:"is_advertiser"`
+ IsAdvertiser BaseBoolInt `json:"is_advertiser,omitempty"`
// Information whether current user is member.
- IsMember BaseBoolInt `json:"is_member"`
+ IsMember BaseBoolInt `json:"is_member,omitempty"`
// Information whether community is in faves.
- IsFavorite BaseBoolInt `json:"is_favorite"`
+ IsFavorite BaseBoolInt `json:"is_favorite,omitempty"`
// Information whether community is adult.
- IsAdult BaseBoolInt `json:"is_adult"`
+ IsAdult BaseBoolInt `json:"is_adult,omitempty"`
// Information whether current user is subscribed.
- IsSubscribed BaseBoolInt `json:"is_subscribed"`
+ IsSubscribed BaseBoolInt `json:"is_subscribed,omitempty"`
// Information whether current user can post on community's wall.
- CanPost BaseBoolInt `json:"can_post"`
+ CanPost BaseBoolInt `json:"can_post,omitempty"`
// Information whether current user can see all posts on community's wall.
- CanSeeAllPosts BaseBoolInt `json:"can_see_all_posts"`
+ CanSeeAllPosts BaseBoolInt `json:"can_see_all_posts,omitempty"`
// Information whether current user can create topic.
- CanCreateTopic BaseBoolInt `json:"can_create_topic"`
+ CanCreateTopic BaseBoolInt `json:"can_create_topic,omitempty"`
// Information whether current user can upload video.
- CanUploadVideo BaseBoolInt `json:"can_upload_video"`
+ CanUploadVideo BaseBoolInt `json:"can_upload_video,omitempty"`
// Information whether current user can upload doc.
- CanUploadDoc BaseBoolInt `json:"can_upload_doc"`
+ CanUploadDoc BaseBoolInt `json:"can_upload_doc,omitempty"`
// Information whether community has photo.
- HasPhoto BaseBoolInt `json:"has_photo"`
+ HasPhoto BaseBoolInt `json:"has_photo,omitempty"`
// Information whether current user can send a message to community.
- CanMessage BaseBoolInt `json:"can_message"`
+ CanMessage BaseBoolInt `json:"can_message,omitempty"`
// Information whether community can send a message to current user.
- IsMessagesBlocked BaseBoolInt `json:"is_messages_blocked"`
+ IsMessagesBlocked BaseBoolInt `json:"is_messages_blocked,omitempty"`
// Information whether community can send notifications by phone number to current user.
- CanSendNotify BaseBoolInt `json:"can_send_notify"`
+ CanSendNotify BaseBoolInt `json:"can_send_notify,omitempty"`
// Information whether current user is subscribed to podcasts.
- IsSubscribedPodcasts BaseBoolInt `json:"is_subscribed_podcasts"`
+ IsSubscribedPodcasts BaseBoolInt `json:"is_subscribed_podcasts,omitempty"`
// Owner in whitelist or not.
- CanSubscribePodcasts BaseBoolInt `json:"can_subscribe_podcasts"`
+ CanSubscribePodcasts BaseBoolInt `json:"can_subscribe_podcasts,omitempty"`
// Can subscribe to wall.
- CanSubscribePosts BaseBoolInt `json:"can_subscribe_posts"`
+ CanSubscribePosts BaseBoolInt `json:"can_subscribe_posts,omitempty"`
// Information whether community has market app.
- HasMarketApp BaseBoolInt `json:"has_market_app"`
- IsHiddenFromFeed BaseBoolInt `json:"is_hidden_from_feed"`
- IsMarketCartEnabled BaseBoolInt `json:"is_market_cart_enabled"`
- Verified BaseBoolInt `json:"verified"` // Information whether community is verified
+ HasMarketApp BaseBoolInt `json:"has_market_app,omitempty"`
+ IsHiddenFromFeed BaseBoolInt `json:"is_hidden_from_feed,omitempty"`
+ IsMarketCartEnabled BaseBoolInt `json:"is_market_cart_enabled,omitempty"`
+ Verified BaseBoolInt `json:"verified,omitempty"` // Information whether community is verified
// Information whether the community has a fire pictogram.
- Trending BaseBoolInt `json:"trending"`
- Description string `json:"description"` // Community description
- WikiPage string `json:"wiki_page"` // Community's main wiki page title
- MembersCount int `json:"members_count"` // Community members number
- Counters GroupsCountersGroup `json:"counters"`
- Cover GroupsCover `json:"cover"`
+ Trending BaseBoolInt `json:"trending,omitempty"`
+ Description string `json:"description,omitempty"` // Community description
+ WikiPage string `json:"wiki_page,omitempty"` // Community's main wiki page title
+ MembersCount int `json:"members_count,omitempty"` // Community members number
+ Counters GroupsCountersGroup `json:"counters,omitempty"`
+ Cover GroupsCover `json:"cover,omitempty"`
// Type of group, start date of event or category of public page.
- Activity string `json:"activity"`
- FixedPost int `json:"fixed_post"` // Fixed post ID
- Status string `json:"status"` // Community status
- MainAlbumID int `json:"main_album_id"` // Community's main photo album ID
- Links []GroupsLinksItem `json:"links"`
- Contacts []GroupsContactsItem `json:"contacts"`
- Site string `json:"site"` // Community's website
- MainSection int `json:"main_section"`
- OnlineStatus GroupsOnlineStatus `json:"online_status"` // Status of replies in community messages
- AgeLimits int `json:"age_limits"` // Information whether age limit
- BanInfo GroupsGroupBanInfo `json:"ban_info"` // User ban info
- Addresses GroupsAddressesInfo `json:"addresses"` // Info about addresses in Groups
- LiveCovers GroupsLiveCovers `json:"live_covers"`
- CropPhoto UsersCropPhoto `json:"crop_photo"`
- Wall int `json:"wall"`
- ActionButton GroupsActionButton `json:"action_button"`
- TrackCode string `json:"track_code"`
- PublicDateLabel string `json:"public_date_label"`
- AuthorID int `json:"author_id"`
- Phone string `json:"phone"`
+ Activity string `json:"activity,omitempty"`
+ FixedPost int `json:"fixed_post,omitempty"` // Fixed post ID
+ Status string `json:"status,omitempty"` // Community status
+ MainAlbumID int `json:"main_album_id,omitempty"` // Community's main photo album ID
+ Links []GroupsLinksItem `json:"links,omitempty"`
+ Contacts []GroupsContactsItem `json:"contacts,omitempty"`
+ Site string `json:"site,omitempty"` // Community's website
+ MainSection int `json:"main_section,omitempty"`
+ OnlineStatus GroupsOnlineStatus `json:"online_status,omitempty"` // Status of replies in community messages
+ AgeLimits int `json:"age_limits,omitempty"` // Information whether age limit
+ BanInfo GroupsGroupBanInfo `json:"ban_info,omitempty"` // User ban info
+ Addresses GroupsAddressesInfo `json:"addresses,omitempty"` // Info about addresses in Groups
+ LiveCovers GroupsLiveCovers `json:"live_covers,omitempty"`
+ CropPhoto UsersCropPhoto `json:"crop_photo,omitempty"`
+ Wall int `json:"wall,omitempty"`
+ ActionButton GroupsActionButton `json:"action_button,omitempty"`
+ TrackCode string `json:"track_code,omitempty"`
+ PublicDateLabel string `json:"public_date_label,omitempty"`
+ AuthorID int `json:"author_id,omitempty"`
+ Phone string `json:"phone,omitempty"`
+ Like GroupsGroupLike `json:"like"`
}
// ToMention return mention.
@@ -223,6 +228,18 @@ func (group GroupsGroup) ToMention() string {
return fmt.Sprintf("[club%d|%s]", group.ID, group.Name)
}
+// GroupsGroupLike struct.
+type GroupsGroupLike struct {
+ IsLiked BaseBoolInt `json:"is_liked"`
+ Friends GroupsGroupLikeFriends `json:"friends"`
+}
+
+// GroupsGroupLikeFriends struct.
+type GroupsGroupLikeFriends struct {
+ Count int `json:"count"`
+ Preview []int `json:"preview"`
+}
+
// GroupsLiveCovers struct.
type GroupsLiveCovers struct {
IsEnabled BaseBoolInt `json:"is_enabled"`
@@ -275,16 +292,70 @@ type GroupsContactsItem struct {
// GroupsCountersGroup struct.
type GroupsCountersGroup struct {
- Addresses int `json:"addresses"` // Addresses number
- Albums int `json:"albums"` // Photo albums number
- Articles int `json:"articles"` // Articles number
- Audios int `json:"audios"` // Audios number
- Docs int `json:"docs"` // Docs number
- Market int `json:"market"` // Market items number
- Photos int `json:"photos"` // Photos number
- Topics int `json:"topics"` // Topics number
- Videos int `json:"videos"` // Videos number
- Narratives int `json:"narratives"` // Narratives number
+ Addresses int `json:"addresses"` // Addresses number
+ Albums int `json:"albums"` // Photo albums number
+ Articles int `json:"articles"` // Articles number
+ Audios int `json:"audios"` // Audios number
+ Docs int `json:"docs"` // Docs number
+ Market int `json:"market"` // Market items number
+ Photos int `json:"photos"` // Photos number
+ Topics int `json:"topics"` // Topics number
+ Videos int `json:"videos"` // Videos number
+ Narratives int `json:"narratives"` // Narratives number
+ Clips int `json:"clips"` // Clips number
+ ClipsFollowers int `json:"clips_followers"` // Clips followers number
+}
+
+// UnmarshalJSON GroupsCountersGroup.
+//
+// BUG(VK): GroupsCountersGroup return [].
+func (personal *GroupsCountersGroup) UnmarshalJSON(data []byte) error {
+ if bytes.Equal(data, []byte("[]")) {
+ return nil
+ }
+
+ type renamedGroupsCountersGroup GroupsCountersGroup
+
+ var r renamedGroupsCountersGroup
+
+ err := json.Unmarshal(data, &r)
+ if err != nil {
+ return err
+ }
+
+ *personal = GroupsCountersGroup(r)
+
+ return nil
+}
+
+// DecodeMsgpack GroupsCountersGroup.
+//
+// BUG(VK): GroupsCountersGroup return [].
+func (personal *GroupsCountersGroup) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ if bytes.Equal(data, []byte{msgpcode.FixedArrayLow}) {
+ return nil
+ }
+
+ type renamedGroupsCountersGroup GroupsCountersGroup
+
+ var r renamedGroupsCountersGroup
+
+ d := msgpack.NewDecoder(bytes.NewReader(data))
+ d.SetCustomStructTag("json")
+
+ err = d.Decode(&r)
+ if err != nil {
+ return err
+ }
+
+ *personal = GroupsCountersGroup(r)
+
+ return nil
}
// GroupsCover struct.
@@ -479,6 +550,70 @@ type GroupsGroupSettings struct {
SecondarySection int `json:"secondary_section"`
ActionButton GroupsActionButton `json:"action_button"`
Phone string `json:"phone"`
+
+ RecognizePhoto int `json:"recognize_photo"`
+
+ MarketServices GroupsMarketServices `json:"market_services"`
+ Narratives int `json:"narratives"`
+ Clips int `json:"clips"`
+ Textlives int `json:"textlives"`
+ Youla GroupsYoula `json:"youla"`
+}
+
+// GroupsMarketServices struct.
+type GroupsMarketServices struct {
+ Enabled BaseBoolInt `json:"enabled"`
+ CanMessage BaseBoolInt `json:"can_message"`
+ CommentsEnabled BaseBoolInt `json:"comments_enabled"`
+ ContactID int `json:"contact_id"`
+ Currency MarketCurrency `json:"currency"`
+ ViewType GroupsSelectedItems `json:"view_type"`
+ BlockName GroupsSelectedItems `json:"block_name"`
+ ButtonLabel GroupsSelectedItems `json:"button_label"`
+}
+
+// GroupsSelectedItems struct.
+type GroupsSelectedItems struct {
+ SelectedItemID int64 `json:"selected_item_id"`
+ Items []BaseObjectWithName `json:"items"`
+}
+
+// GroupsYoula struct.
+type GroupsYoula struct {
+ CategoryTree GroupsYoulaCategory `json:"category_tree"`
+ GroupSettings GroupsYoulaSettings `json:"group_settings"`
+}
+
+// GroupsYoulaCategory struct.
+type GroupsYoulaCategory struct {
+ ID int `json:"id"`
+ Title string `json:"title"`
+ Subcategories []GroupsYoulaSubcategory `json:"subcategories"`
+}
+
+// GroupsYoulaSubcategory struct.
+type GroupsYoulaSubcategory struct {
+ ID int `json:"id"`
+ Title string `json:"title"`
+ ParentID int `json:"parent_id"`
+ Subcategories []GroupsYoulaSubcategory `json:"subcategories"`
+}
+
+// GroupsYoulaSettings struct.
+type GroupsYoulaSettings struct {
+ IsActive BaseBoolInt `json:"is_active"`
+ IsModerated BaseBoolInt `json:"is_moderated"`
+ ShowModerationSetting BaseBoolInt `json:"show_moderation_setting"`
+ ModerationStatus int `json:"moderation_status"`
+ DeclineReason string `json:"decline_reason"`
+ GroupMode int `json:"group_mode"`
+ SelectedCategoryIDS []int `json:"selected_category_ids"`
+ Lat float64 `json:"lat"`
+ Long float64 `json:"long"`
+ Radius float64 `json:"radius"`
+ RadiusArea string `json:"radius_area"`
+ Address string `json:"address"`
+ Radiuses []float64 `json:"radiuses"`
}
// GroupsSectionsList struct.
@@ -532,6 +667,53 @@ func (g *GroupsSectionsList) UnmarshalJSON(data []byte) error {
return nil
}
+// DecodeMsgpack need for decode dynamic array (Example: [1, "Фотографии"]) to struct.
+func (g *GroupsSectionsList) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ var alias []interface{}
+
+ err = msgpack.Unmarshal(data, &alias)
+ if err != nil {
+ return err
+ }
+
+ if len(alias) != 2 {
+ return &json.UnmarshalTypeError{
+ Value: string(data),
+ Type: reflect.TypeOf((*GroupsSectionsList)(nil)),
+ }
+ }
+
+ id, ok := alias[0].(int8)
+ if !ok {
+ return &json.UnmarshalTypeError{
+ Value: string(data),
+ Type: reflect.TypeOf((*GroupsSectionsList)(nil)),
+ Struct: "GroupsSectionsList",
+ Field: "ID",
+ }
+ }
+
+ name, ok := alias[1].(string)
+ if !ok {
+ return &json.UnmarshalTypeError{
+ Value: string(data),
+ Type: reflect.TypeOf((*GroupsSectionsList)(nil)),
+ Struct: "GroupsSectionsList",
+ Field: "Name",
+ }
+ }
+
+ g.ID = int(id)
+ g.Name = name
+
+ return nil
+}
+
// GroupsActionType for action_button in groups.
type GroupsActionType string
@@ -685,7 +867,10 @@ type GroupsLongPollServer struct {
Ts string `json:"ts"` // Number of the last event
}
-// TODO: func (g GroupsLongPollServer) GetURL() string {
+// GetURL return link.
+func (lp GroupsLongPollServer) GetURL(wait int) string {
+ return fmt.Sprintf("%s?act=a_check&key=%s&ts=%s&wait=%d", lp.Server, lp.Key, lp.Ts, wait)
+}
// GroupsLongPollSettings struct.
type GroupsLongPollSettings struct {
@@ -714,12 +899,14 @@ type GroupsMarketInfo struct {
Enabled BaseBoolInt `json:"enabled"` // Information whether the market is enabled
CommentsEnabled BaseBoolInt `json:"comments_enabled,omitempty"`
CanMessage BaseBoolInt `json:"can_message,omitempty"`
+ IsHsEnabled BaseBoolInt `json:"is_hs_enabled,omitempty"`
MainAlbumID int `json:"main_album_id,omitempty"` // Main market album ID
PriceMax string `json:"price_max,omitempty"` // Maximum price
PriceMin string `json:"price_min,omitempty"` // Minimum price
Wiki PagesWikipageFull `json:"wiki,omitempty"`
CityIDs []int `json:"city_ids"`
CountryIDs []int `json:"country_ids,omitempty"`
+ MinOrderPrice MarketPrice `json:"min_order_price,omitempty"`
}
// GroupsGroupRole Role type.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/market.go b/vendor/github.com/SevereCloud/vksdk/v2/object/market.go
index a1d75213..7fb5f6af 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/market.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/market.go
@@ -4,6 +4,9 @@ import (
"bytes"
"encoding/json"
"fmt"
+
+ "github.com/vmihailenco/msgpack/v5"
+ "github.com/vmihailenco/msgpack/v5/msgpcode"
)
// Information whether the MarketMarketItem is available.
@@ -100,6 +103,36 @@ func (market *MarketMarketItem) UnmarshalJSON(data []byte) error {
return nil
}
+// DecodeMsgpack MarketMarketItem.
+//
+// BUG(VK): https://github.com/SevereCloud/vksdk/issues/147
+func (market *MarketMarketItem) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ if bytes.Equal(data, []byte{msgpcode.False}) {
+ return nil
+ }
+
+ type renamedMarketMarketItem MarketMarketItem
+
+ var r renamedMarketMarketItem
+
+ d := msgpack.NewDecoder(bytes.NewReader(data))
+ d.SetCustomStructTag("json")
+
+ err = d.Decode(&r)
+ if err != nil {
+ return err
+ }
+
+ *market = MarketMarketItem(r)
+
+ return nil
+}
+
// MarketMarketItemProperty struct.
type MarketMarketItemProperty struct {
VariantID int `json:"variant_id"`
@@ -151,6 +184,36 @@ func (m *MarketPrice) UnmarshalJSON(data []byte) error {
return nil
}
+// DecodeMsgpack MarketPrice.
+//
+// BUG(VK): unavailable product, in fave.get return [].
+func (m *MarketPrice) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ if bytes.Equal(data, []byte{msgpcode.FixedArrayLow}) {
+ return nil
+ }
+
+ type renamedMarketPrice MarketPrice
+
+ var r renamedMarketPrice
+
+ d := msgpack.NewDecoder(bytes.NewReader(data))
+ d.SetCustomStructTag("json")
+
+ err = d.Decode(&r)
+ if err != nil {
+ return err
+ }
+
+ *m = MarketPrice(r)
+
+ return nil
+}
+
// MarketSection struct.
type MarketSection struct {
ID int `json:"id"` // Section ID
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/messages.go b/vendor/github.com/SevereCloud/vksdk/v2/object/messages.go
index 4c553486..2bf69096 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/messages.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/messages.go
@@ -79,6 +79,7 @@ type MessagesMessage struct {
UpdateTime int `json:"update_time"` // Date when the message has been updated in Unixtime
MembersCount int `json:"members_count"` // Members number
ExpireTTL int `json:"expire_ttl"`
+ MessageTag string `json:"message_tag"` // for https://notify.mail.ru/
}
// MessagesBasePayload struct.
@@ -378,7 +379,8 @@ type MessagesTemplateElementCarousel struct {
Title string `json:"title,omitempty"`
Action MessagesTemplateElementCarouselAction `json:"action,omitempty"`
Description string `json:"description,omitempty"`
- Photo *PhotosPhoto `json:"photo,omitempty"`
+ Photo *PhotosPhoto `json:"photo,omitempty"` // Only read
+ PhotoID string `json:"photo_id,omitempty"` // Only for send
Buttons []MessagesKeyboardButton `json:"buttons,omitempty"`
}
@@ -474,20 +476,24 @@ type MessagesChatPushSettings struct {
// MessagesChatSettingsPhoto struct.
type MessagesChatSettingsPhoto struct {
- Photo100 string `json:"photo_100"`
- Photo200 string `json:"photo_200"`
- Photo50 string `json:"photo_50"`
- IsDefaultPhoto BaseBoolInt `json:"is_default_photo"`
+ Photo100 string `json:"photo_100"`
+ Photo200 string `json:"photo_200"`
+ Photo50 string `json:"photo_50"`
+ IsDefaultPhoto BaseBoolInt `json:"is_default_photo"`
+ IsDefaultCallPhoto bool `json:"is_default_call_photo"`
}
// MessagesConversation struct.
type MessagesConversation struct {
- CanWrite MessagesConversationCanWrite `json:"can_write"`
- ChatSettings MessagesConversationChatSettings `json:"chat_settings"`
- InRead int `json:"in_read"` // Last message user have read
- LastMessageID int `json:"last_message_id"` // ID of the last message in conversation
- Mentions []int `json:"mentions"` // IDs of messages with mentions
- MessageRequest string `json:"message_request"`
+ CanWrite MessagesConversationCanWrite `json:"can_write"`
+ ChatSettings MessagesConversationChatSettings `json:"chat_settings"`
+ InRead int `json:"in_read"` // Last message user have read
+ LastMessageID int `json:"last_message_id"` // ID of the last message in conversation
+ Mentions []int `json:"mentions"` // IDs of messages with mentions
+ MessageRequest string `json:"message_request"`
+ LastConversationMessageID int `json:"last_conversation_message_id"`
+ InReadCMID int `json:"in_read_cmid"`
+ OutReadCMID int `json:"out_read_cmid"`
// Last outcoming message have been read by the opponent.
OutRead int `json:"out_read"`
@@ -496,6 +502,10 @@ type MessagesConversation struct {
Important BaseBoolInt `json:"important"`
Unanswered BaseBoolInt `json:"unanswered"`
IsMarkedUnread BaseBoolInt `json:"is_marked_unread"`
+ CanSendMoney BaseBoolInt `json:"can_send_money"`
+ CanReceiveMoney BaseBoolInt `json:"can_receive_money"`
+ IsNew BaseBoolInt `json:"is_new"`
+ IsArchived BaseBoolInt `json:"is_archived"`
UnreadCount int `json:"unread_count"` // Unread messages number
CurrentKeyboard MessagesKeyboard `json:"current_keyboard"`
SortID struct {
@@ -531,6 +541,7 @@ type MessagesConversationChatSettings struct {
CanCall BaseBoolInt `json:"can_call"`
CanUseMassMentions BaseBoolInt `json:"can_use_mass_mentions"`
CanChangeServiceType BaseBoolInt `json:"can_change_service_type"`
+ CanChangeStyle BaseBoolInt `json:"can_change_style"`
} `json:"acl"`
IsGroupChannel BaseBoolInt `json:"is_group_channel"`
IsDisappearing BaseBoolInt `json:"is_disappearing"`
@@ -560,6 +571,7 @@ type MessagesChatPermissions struct {
SeeInviteLink MessagesChatPermission `json:"see_invite_link"`
Call MessagesChatPermission `json:"call"`
ChangeAdmins MessagesChatPermission `json:"change_admins"`
+ ChangeStyle MessagesChatPermission `json:"change_style"`
}
// MessagesConversationPeer struct.
@@ -571,9 +583,11 @@ type MessagesConversationPeer struct {
// MessagesConversationPushSettings struct.
type MessagesConversationPushSettings struct {
- DisabledUntil int `json:"disabled_until"`
- DisabledForever BaseBoolInt `json:"disabled_forever"`
- NoSound BaseBoolInt `json:"no_sound"`
+ DisabledUntil int `json:"disabled_until"`
+ DisabledForever BaseBoolInt `json:"disabled_forever"`
+ NoSound BaseBoolInt `json:"no_sound"`
+ DisabledMentions BaseBoolInt `json:"disabled_mentions"`
+ DisabledMassMentions BaseBoolInt `json:"disabled_mass_mentions"`
}
// MessagesConversationWithMessage struct.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/notifications.go b/vendor/github.com/SevereCloud/vksdk/v2/object/notifications.go
index 119c3f9f..781a1de7 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/notifications.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/notifications.go
@@ -1,7 +1,5 @@
package object // import "github.com/SevereCloud/vksdk/v2/object"
-import "encoding/json"
-
// NotificationsFeedback struct.
type NotificationsFeedback struct {
Attachments []WallWallpostAttachment `json:"attachments"`
@@ -16,8 +14,8 @@ type NotificationsFeedback struct {
// NotificationsNotification struct.
type NotificationsNotification struct {
Date int `json:"date"` // Date when the event has been occurred
- Feedback json.RawMessage `json:"feedback"`
- Parent json.RawMessage `json:"parent"`
+ Feedback RawMessage `json:"feedback"`
+ Parent RawMessage `json:"parent"`
Reply NotificationsReply `json:"reply"`
Type string `json:"type"` // Notification type
}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/object.go b/vendor/github.com/SevereCloud/vksdk/v2/object/object.go
index e6c89efd..e03e7f3b 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/object.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/object.go
@@ -9,6 +9,8 @@ import (
"bytes"
"encoding/json"
"reflect"
+
+ "github.com/vmihailenco/msgpack/v5"
)
// Attachment interface.
@@ -42,6 +44,44 @@ func (b *BaseBoolInt) UnmarshalJSON(data []byte) (err error) {
return
}
+// DecodeMsgpack func.
+func (b *BaseBoolInt) DecodeMsgpack(dec *msgpack.Decoder) (err error) {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ var (
+ valueInt int
+ valueBool bool
+ )
+
+ switch {
+ case msgpack.Unmarshal(data, &valueBool) == nil:
+ *b = BaseBoolInt(valueBool)
+ case msgpack.Unmarshal(data, &valueInt) == nil:
+ if valueInt == 1 {
+ *b = true
+ break
+ }
+
+ if valueInt == 0 {
+ *b = false
+ break
+ }
+
+ fallthrough
+ default:
+ // return msgpack error
+ err = &json.UnmarshalTypeError{
+ Value: string(data),
+ Type: reflect.TypeOf((*BaseBoolInt)(nil)),
+ }
+ }
+
+ return err
+}
+
// BaseCountry struct.
type BaseCountry struct {
ID int `json:"id"`
@@ -151,6 +191,33 @@ func (obj *BaseImage) UnmarshalJSON(data []byte) (err error) {
return err
}
+// DecodeMsgpack is required to support images with `src` field.
+func (obj *BaseImage) DecodeMsgpack(dec *msgpack.Decoder) (err error) {
+ type renamedBaseImage struct {
+ Height float64 `msgpack:"height"`
+ URL string `msgpack:"url"`
+ Src string `msgpack:"src"`
+ Width float64 `msgpack:"width"`
+ Type string `msgpack:"type"`
+ }
+
+ var renamedObj renamedBaseImage
+
+ err = dec.Decode(&renamedObj)
+
+ obj.Height = renamedObj.Height
+ obj.Width = renamedObj.Width
+ obj.Type = renamedObj.Type
+
+ if renamedObj.Src == "" {
+ obj.URL = renamedObj.URL
+ } else {
+ obj.URL = renamedObj.Src
+ }
+
+ return err
+}
+
// BaseLikes struct.
type BaseLikes struct {
UserLikes BaseBoolInt `json:"user_likes"` // Information whether current user likes
@@ -346,9 +413,11 @@ const (
type Privacy struct {
Category PrivacyCategory `json:"category,omitempty"`
Lists struct {
- Allowed []int `json:"allowed"`
+ Allowed []int `json:"allowed"`
+ Excluded []int `json:"excluded"`
} `json:"lists,omitempty"`
Owners struct {
+ Allowed []int `json:"allowed"`
Excluded []int `json:"excluded"`
} `json:"owners,omitempty"`
}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/photos.go b/vendor/github.com/SevereCloud/vksdk/v2/object/photos.go
index ecbe0dcb..81739bb9 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/photos.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/photos.go
@@ -239,6 +239,7 @@ type PhotosPhotoFull struct {
Photo1280 string `json:"photo_1280"` // URL of image with 1280 px width
Photo2560 string `json:"photo_2560"` // URL of image with 2560 px width
Sizes []PhotosPhotoSizes `json:"sizes"`
+ OrigPhoto PhotosPhotoSizes `json:"orig_photo"`
}
// ToAttachment return attachment format.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/raw.go b/vendor/github.com/SevereCloud/vksdk/v2/object/raw.go
new file mode 100644
index 00000000..9492f67d
--- /dev/null
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/raw.go
@@ -0,0 +1,39 @@
+package object // import "github.com/SevereCloud/vksdk/v2/object"
+
+import "github.com/vmihailenco/msgpack/v5"
+
+// RawMessage is a raw encoded JSON or MessagePack value.
+type RawMessage []byte
+
+// MarshalJSON returns m as the JSON encoding of m.
+func (m RawMessage) MarshalJSON() ([]byte, error) {
+ if m == nil {
+ return []byte("null"), nil
+ }
+
+ return m, nil
+}
+
+// UnmarshalJSON sets *m to a copy of data.
+func (m *RawMessage) UnmarshalJSON(data []byte) error {
+ *m = append((*m)[0:0], data...)
+ return nil
+}
+
+// EncodeMsgpack write m as the MessagePack encoding of m.
+func (m RawMessage) EncodeMsgpack(enc *msgpack.Encoder) error {
+ _, err := enc.Writer().Write(m)
+ return err
+}
+
+// DecodeMsgpack sets *m to a copy of data.
+func (m *RawMessage) DecodeMsgpack(dec *msgpack.Decoder) error {
+ msg, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ *m = RawMessage(msg)
+
+ return nil
+}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/stories.go b/vendor/github.com/SevereCloud/vksdk/v2/object/stories.go
index c04ab653..5f87745a 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/stories.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/stories.go
@@ -127,6 +127,7 @@ type StoriesStory struct {
Seen BaseBoolInt `json:"seen"`
IsOwnerPinned BaseBoolInt `json:"is_owner_pinned"`
IsOneTime BaseBoolInt `json:"is_one_time"`
+ IsAdvice BaseBoolInt `json:"is_advice,omitempty"`
NeedMute BaseBoolInt `json:"need_mute"`
MuteReply BaseBoolInt `json:"mute_reply"`
CanLike BaseBoolInt `json:"can_like"`
@@ -152,6 +153,7 @@ type StoriesStory struct {
NarrativesCount int `json:"narratives_count"`
FirstNarrativeTitle string `json:"first_narrative_title"`
Questions StoriesQuestions `json:"questions"`
+ ReactionSetID string `json:"reaction_set_id"`
}
// StoriesFeedItemType type.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/users.go b/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
index 24a08d63..7bf93b40 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/users.go
@@ -4,6 +4,9 @@ import (
"bytes"
"encoding/json"
"fmt"
+
+ "github.com/vmihailenco/msgpack/v5"
+ "github.com/vmihailenco/msgpack/v5/msgpcode"
)
// User relationship status.
@@ -258,6 +261,36 @@ func (personal *UsersPersonal) UnmarshalJSON(data []byte) error {
return nil
}
+// DecodeMsgpack UsersPersonal.
+//
+// BUG(VK): UsersPersonal return [].
+func (personal *UsersPersonal) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ if bytes.Equal(data, []byte{msgpcode.FixedArrayLow}) {
+ return nil
+ }
+
+ type renamedUsersPersonal UsersPersonal
+
+ var r renamedUsersPersonal
+
+ d := msgpack.NewDecoder(bytes.NewReader(data))
+ d.SetCustomStructTag("json")
+
+ err = d.Decode(&r)
+ if err != nil {
+ return err
+ }
+
+ *personal = UsersPersonal(r)
+
+ return nil
+}
+
// UsersRelative struct.
type UsersRelative struct {
BirthDate string `json:"birth_date"` // Date of child birthday (format dd.mm.yyyy)
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/utils.go b/vendor/github.com/SevereCloud/vksdk/v2/object/utils.go
index 3bbd775d..408cf7f9 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/utils.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/utils.go
@@ -1,5 +1,13 @@
package object // import "github.com/SevereCloud/vksdk/v2/object"
+import (
+ "bytes"
+ "encoding/json"
+
+ "github.com/vmihailenco/msgpack/v5"
+ "github.com/vmihailenco/msgpack/v5/msgpcode"
+)
+
// UtilsDomainResolvedType object type.
const (
UtilsDomainResolvedTypeUser = "user"
@@ -15,6 +23,58 @@ type UtilsDomainResolved struct {
Type string `json:"type"`
}
+// UnmarshalJSON UtilsDomainResolved.
+//
+// BUG(VK): UtilsDomainResolved return [].
+func (link *UtilsDomainResolved) UnmarshalJSON(data []byte) error {
+ if bytes.Equal(data, []byte("[]")) {
+ return nil
+ }
+
+ type renamedUtilsDomainResolved UtilsDomainResolved
+
+ var r renamedUtilsDomainResolved
+
+ err := json.Unmarshal(data, &r)
+ if err != nil {
+ return err
+ }
+
+ *link = UtilsDomainResolved(r)
+
+ return nil
+}
+
+// DecodeMsgpack UtilsDomainResolved.
+//
+// BUG(VK): UtilsDomainResolved return [].
+func (link *UtilsDomainResolved) DecodeMsgpack(dec *msgpack.Decoder) error {
+ data, err := dec.DecodeRaw()
+ if err != nil {
+ return err
+ }
+
+ if bytes.Equal(data, []byte{msgpcode.FixedArrayLow}) {
+ return nil
+ }
+
+ type renamedUtilsDomainResolved UtilsDomainResolved
+
+ var r renamedUtilsDomainResolved
+
+ d := msgpack.NewDecoder(bytes.NewReader(data))
+ d.SetCustomStructTag("json")
+
+ err = d.Decode(&r)
+ if err != nil {
+ return err
+ }
+
+ *link = UtilsDomainResolved(r)
+
+ return nil
+}
+
// UtilsLastShortenedLink struct.
type UtilsLastShortenedLink struct {
AccessKey string `json:"access_key"` // Access key for private stats
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/video.go b/vendor/github.com/SevereCloud/vksdk/v2/object/video.go
index 5a7e9e8d..6c48224b 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/video.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/video.go
@@ -12,6 +12,9 @@ type VideoVideo struct {
// Date when the video has been added in Unixtime.
AddingDate int `json:"adding_date"`
+ // Date when the video has been released in Unixtime.
+ ReleaseDate int `json:"release_date"`
+
// Information whether current user can add the video.
CanAdd BaseBoolInt `json:"can_add"`
@@ -27,12 +30,17 @@ type VideoVideo struct {
// Information whether current user can like the video.
CanLike BaseBoolInt `json:"can_like"`
+ // Information whether current user can download the video.
+ CanDownload BaseBoolInt `json:"can_download"`
+
// Information whether current user can repost this video.
CanRepost BaseBoolInt `json:"can_repost"`
CanSubscribe BaseBoolInt `json:"can_subscribe"`
CanAttachLink BaseBoolInt `json:"can_attach_link"`
IsFavorite BaseBoolInt `json:"is_favorite"`
IsPrivate BaseBoolInt `json:"is_private"`
+ IsExplicit BaseBoolInt `json:"is_explicit"`
+ IsSubscribed BaseBoolInt `json:"is_subscribed"`
Added BaseBoolInt `json:"added"`
Repeat BaseBoolInt `json:"repeat"` // Information whether the video is repeated
ContentRestricted int `json:"content_restricted"`
@@ -43,6 +51,7 @@ type VideoVideo struct {
Description string `json:"description"` // Video description
Duration int `json:"duration"` // Video duration in seconds
Files VideoVideoFiles `json:"files"`
+ Trailer VideoVideoFiles `json:"trailer,omitempty"`
FirstFrame []VideoVideoImage `json:"first_frame"`
Image []VideoVideoImage `json:"image"`
Height int `json:"height"` // Video height
@@ -56,22 +65,27 @@ type VideoVideo struct {
Photo1280 string `json:"photo_1280"` // URL of the preview image with 1280 px in width
// URL of the page with a player that can be used to play the video in the browser.
- Player string `json:"player"`
- Processing int `json:"processing"` // Returns if the video is processing
- Title string `json:"title"` // Video title
- Type string `json:"type"`
- Views int `json:"views"` // Number of views
- Width int `json:"width"` // Video width
- Platform string `json:"platform"`
- LocalViews int `json:"local_views"`
- Likes BaseLikesInfo `json:"likes"` // Count of likes
- Reposts BaseRepostsInfo `json:"reposts"` // Count of views
- TrackCode string `json:"track_code"`
- PrivacyView Privacy `json:"privacy_view"`
- PrivacyComment Privacy `json:"privacy_comment"`
- ActionButton VideoActionButton `json:"action_button"`
- Restriction VideoRestriction `json:"restriction"`
- ContentRestrictedMessage string `json:"content_restricted_message"`
+ Player string `json:"player"`
+ Processing int `json:"processing"` // Returns if the video is processing
+ Title string `json:"title"` // Video title
+ Subtitle string `json:"subtitle"` // Video subtitle
+ Type string `json:"type"`
+ Views int `json:"views"` // Number of views
+ Width int `json:"width"` // Video width
+ Platform string `json:"platform"`
+ LocalViews int `json:"local_views"`
+ Likes BaseLikesInfo `json:"likes"` // Count of likes
+ Reposts BaseRepostsInfo `json:"reposts"` // Count of views
+ TrackCode string `json:"track_code"`
+ PrivacyView Privacy `json:"privacy_view"`
+ PrivacyComment Privacy `json:"privacy_comment"`
+ ActionButton VideoActionButton `json:"action_button"`
+ Restriction VideoRestriction `json:"restriction"`
+ ContentRestrictedMessage string `json:"content_restricted_message"`
+ MainArtists []AudioAudioArtist `json:"main_artists"`
+ FeaturedArtists []AudioAudioArtist `json:"featured_artists"`
+ Genres []BaseObjectWithName `json:"genres"`
+ OvID string `json:"ov_id,omitempty"`
}
// ToAttachment return attachment format.
@@ -112,16 +126,20 @@ type VideoSnippet struct {
// VideoVideoFiles struct.
type VideoVideoFiles struct {
- External string `json:"external"` // URL of the external player
- Mp4_1080 string `json:"mp4_1080"` // URL of the mpeg4 file with 1080p quality
- Mp4_1440 string `json:"mp4_1440"` // URL of the mpeg4 file with 2k quality
- Mp4_2160 string `json:"mp4_2160"` // URL of the mpeg4 file with 4k quality
- Mp4_240 string `json:"mp4_240"` // URL of the mpeg4 file with 240p quality
- Mp4_360 string `json:"mp4_360"` // URL of the mpeg4 file with 360p quality
- Mp4_480 string `json:"mp4_480"` // URL of the mpeg4 file with 480p quality
- Mp4_720 string `json:"mp4_720"` // URL of the mpeg4 file with 720p quality
- Live string `json:"live"`
- HLS string `json:"hls"`
+ External string `json:"external,omitempty"` // URL of the external player
+ Mp4_1080 string `json:"mp4_1080,omitempty"` // URL of the mpeg4 file with 1080p quality
+ Mp4_1440 string `json:"mp4_1440,omitempty"` // URL of the mpeg4 file with 2k quality
+ Mp4_2160 string `json:"mp4_2160,omitempty"` // URL of the mpeg4 file with 4k quality
+ Mp4_240 string `json:"mp4_240,omitempty"` // URL of the mpeg4 file with 240p quality
+ Mp4_360 string `json:"mp4_360,omitempty"` // URL of the mpeg4 file with 360p quality
+ Mp4_480 string `json:"mp4_480,omitempty"` // URL of the mpeg4 file with 480p quality
+ Mp4_720 string `json:"mp4_720,omitempty"` // URL of the mpeg4 file with 720p quality
+ Live string `json:"live,omitempty"`
+ HLS string `json:"hls,omitempty"`
+ DashUni string `json:"dash_uni,omitempty"`
+ DashSep string `json:"dash_sep,omitempty"`
+ DashWebm string `json:"dash_webm,omitempty"`
+ FailoverHost string `json:"failover_host,omitempty"`
}
// VideoCatBlock struct.
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/wall.go b/vendor/github.com/SevereCloud/vksdk/v2/object/wall.go
index 3dc2ad4f..1a195b39 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/wall.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/wall.go
@@ -128,7 +128,7 @@ const (
WallPostTypeSuggest = "suggest"
)
-// WallWallpost struct.
+// WallWallpost struct.
type WallWallpost struct {
AccessKey string `json:"access_key"` // Access key to private object
ID int `json:"id"` // Post ID
@@ -156,14 +156,17 @@ type WallWallpost struct {
IsPinned BaseBoolInt `json:"is_pinned"`
IsFavorite BaseBoolInt `json:"is_favorite"` // Information whether the post in favorites list
IsArchived BaseBoolInt `json:"is_archived"` // Is post archived, only for post owners
+ IsDeleted BaseBoolInt `json:"is_deleted"`
MarkedAsAds BaseBoolInt `json:"marked_as_ads"`
Edited int `json:"edited"` // Date of editing in Unixtime
Copyright WallPostCopyright `json:"copyright"`
PostID int `json:"post_id"`
ParentsStack []int `json:"parents_stack"`
- Donut WallWallpostDonut `json:"donut"` // need api v5.125
+ Donut WallWallpostDonut `json:"donut"`
ShortTextRate float64 `json:"short_text_rate"`
CarouselOffset int `json:"carousel_offset"`
+ Header WallWallpostHeader `json:"header"`
+ Hash string `json:"hash"`
}
// Attachment type.
@@ -235,8 +238,10 @@ type WallWallpostToID struct {
IsFavorite BaseBoolInt `json:"is_favorite"` // Information whether the post in favorites list
MarkedAsAds BaseBoolInt `json:"marked_as_ads"`
ParentsStack []int `json:"parents_stack"`
- Donut WallWallpostDonut `json:"donut"` // need api v5.125
+ Donut WallWallpostDonut `json:"donut"`
ShortTextRate float64 `json:"short_text_rate"`
+ Views WallViews `json:"views"` // Count of views
+ Header WallWallpostHeader `json:"header"`
}
// WallWallpostDonut info about VK Donut.
@@ -255,3 +260,15 @@ type WallPostCopyright struct {
Type string `json:"type"`
Name string `json:"name"`
}
+
+// WallWallpostHeader struct.
+type WallWallpostHeader struct {
+ Type string `json:"type"`
+ CustomDescription WallWallpostHeaderCustomDescription `json:"custom_description"`
+}
+
+// WallWallpostHeaderCustomDescription struct.
+type WallWallpostHeaderCustomDescription struct {
+ SourceID int `json:"source_id"`
+ Date int `json:"date"`
+}
diff --git a/vendor/github.com/SevereCloud/vksdk/v2/object/widgets.go b/vendor/github.com/SevereCloud/vksdk/v2/object/widgets.go
index 80905a3f..75ca8be2 100644
--- a/vendor/github.com/SevereCloud/vksdk/v2/object/widgets.go
+++ b/vendor/github.com/SevereCloud/vksdk/v2/object/widgets.go
@@ -45,6 +45,9 @@ type WidgetsWidgetComment struct {
Views struct {
Count int `json:"count"`
} `json:"views"`
+ Donut WallWallpostDonut `json:"donut"`
+ ShortTextRate float64 `json:"short_text_rate"`
+ Header WallWallpostHeader `json:"header"`
}
// WidgetsWidgetLikes struct.