From 5a1fd7daddbb07b93e3611d023ea48e1991fc0c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jan 2022 23:48:40 +0100 Subject: 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] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../SevereCloud/vksdk/v2/api/messages.go | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'vendor/github.com/SevereCloud/vksdk/v2/api/messages.go') 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 } -- cgit v1.2.3