Skip to content

Commit

Permalink
BREAKING CHANGE: v2 -> v3
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed Jul 14, 2024
1 parent 4bd4044 commit 30c8ba1
Show file tree
Hide file tree
Showing 292 changed files with 448 additions and 448 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# VK SDK for Golang

[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v2/v2)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2?tab=subdirectories)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v3/v2)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3?tab=subdirectories)
[![VK Developers](https://img.shields.io/badge/developers-%234a76a8.svg?logo=VK&logoColor=white)](https://dev.vk.com/)
[![codecov](https://codecov.io/gh/SevereCloud/vksdk/branch/master/graph/badge.svg)](https://codecov.io/gh/SevereCloud/vksdk)
[![VK chat](https://img.shields.io/badge/VK%20chat-%234a76a8.svg?logo=VK&logoColor=white)](https://vk.me/join/AJQ1d6Or8Q00Y_CSOESfbqGt)
Expand All @@ -15,49 +15,49 @@

Version API 5.199.

- [API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api)
- [API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api)
- 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)
- Support [zstd](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api#VK.EnableZstd)
and [MessagePack](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/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)
- [OAuth](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api/oauth)
- [Callback API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/callback)
- Tracking tool for users activity in your VK communities
- Supports all events
- Auto setting callback
- [Bots Long Poll API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/longpoll-bot)
- [Bots Long Poll API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/longpoll-bot)
- Allows you to work with community events in real time
- Supports all events
- Ability to modify HTTP client
- [User Long Poll API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/longpoll-user)
- [User Long Poll API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/longpoll-user)
- Allows you to work with user events in real time
- Ability to modify HTTP client
- [Streaming API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/streaming)
- [Streaming API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/streaming)
- Receiving public data from VK by specified keywords
- Ability to modify HTTP client
- [FOAF](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/foaf)
- [FOAF](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/foaf)
- Machine-readable ontology describing persons
- Works with users and groups
- The only place to get page creation date
- [Games](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/games)
- [Games](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/games)
- Checking launch parameters
- Intermediate http handler
- [VK Mini Apps](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/vkapps)
- [VK Mini Apps](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/vkapps)
- Checking launch parameters
- Intermediate http handler
- [Payments API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/payments)
- [Payments API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/payments)
- Processes payment notifications
- [Marusia Skills](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/marusia)
- [Marusia Skills](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/marusia)
- For creating Marusia Skills
- Support SSML

## Install

```bash
# go mod init mymodulename
go get github.com/SevereCloud/vksdk/v2@latest
go get github.com/SevereCloud/vksdk/v3@latest
```

## Use by
Expand All @@ -75,10 +75,10 @@ import (
"context"
"log"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v2/api/params"
"github.com/SevereCloud/vksdk/v2/events"
"github.com/SevereCloud/vksdk/v2/longpoll-bot"
"github.com/SevereCloud/vksdk/v3/api"
"github.com/SevereCloud/vksdk/v3/api/params"
"github.com/SevereCloud/vksdk/v3/events"
"github.com/SevereCloud/vksdk/v3/longpoll-bot"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API

[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v2/api)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v3/api)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api)
[![VK](https://img.shields.io/badge/developers-%234a76a8.svg?logo=VK&logoColor=white)](https://dev.vk.com/ru/api/getting-started)

Данная библиотека поддерживает версию API **5.199**.
Expand All @@ -19,7 +19,7 @@ vk := api.NewVK("<TOKEN>")
- `groups.get` с extended=1 -> `vk.GroupsGetExtended(api.Params{})`

Список всех методов можно найти на
[данной странице](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api?tab=doc#VK).
[данной странице](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api?tab=doc#VK).

Пример запроса [`users.get`](https://dev.vk.com/method/users.get)

Expand All @@ -34,12 +34,12 @@ if err != nil {

### Параметры

[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v2/api/params)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api/params)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v3/api/params)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api/params)

Модуль params предназначен для генерации параметров запроса.

```go
// import "github.com/SevereCloud/vksdk/v2/api/params"
// import "github.com/SevereCloud/vksdk/v3/api/params"

b := params.NewMessageSendBuilder()
b.PeerID(123)
Expand Down Expand Up @@ -152,7 +152,7 @@ log.Print(response)

### Execute

[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v2/errors)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api#VK.Execute)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/SevereCloud/vksdk/v3/errors)](https://pkg.go.dev/github.com/SevereCloud/vksdk/v3/api#VK.Execute)
[![VK](https://img.shields.io/badge/developers-%234a76a8.svg?logo=VK&logoColor=white)](https://dev.vk.com/ru/method/execute)

Универсальный метод, который позволяет запускать последовательность других
Expand Down
4 changes: 2 additions & 2 deletions api/account.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// AccountBan account.ban.
Expand Down
2 changes: 1 addition & 1 deletion api/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions api/ads.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"bytes"
"encoding/json"
"fmt"

"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
"github.com/vmihailenco/msgpack/v5"
)

Expand Down
2 changes: 1 addition & 1 deletion api/ads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
"github.com/stretchr/testify/assert"
"github.com/vmihailenco/msgpack/v5"
"github.com/vmihailenco/msgpack/v5/msgpcode"
Expand Down
8 changes: 4 additions & 4 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Package api implements VK API.
See more https://dev.vk.com/ru/api/api-requests
*/
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"bytes"
Expand All @@ -20,9 +20,9 @@ import (
"sync/atomic"
"time"

"github.com/SevereCloud/vksdk/v2"
"github.com/SevereCloud/vksdk/v2/internal"
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3"
"github.com/SevereCloud/vksdk/v3/internal"
"github.com/SevereCloud/vksdk/v3/object"
"github.com/klauspost/compress/zstd"
"github.com/vmihailenco/msgpack/v5"
)
Expand Down
4 changes: 2 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"testing"
"time"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/api"
"github.com/SevereCloud/vksdk/v3/object"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions api/apps.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// AppsAddUsersToTestingGroup method.
Expand Down
2 changes: 1 addition & 1 deletion api/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"

"github.com/stretchr/testify/assert"
)
Expand Down
4 changes: 2 additions & 2 deletions api/appwidgets.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// AppWidgetsGetAppImageUploadServerResponse struct.
Expand Down
4 changes: 2 additions & 2 deletions api/auth.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// AuthCheckPhone checks a user's phone number for correctness.
Expand Down
2 changes: 1 addition & 1 deletion api/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
)

func TestVK_AuthCheckPhone(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/board.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// BoardAddTopic creates a new topic on a community's discussion board.
Expand Down
2 changes: 1 addition & 1 deletion api/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion api/calls.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

// CallsStartResponse struct.
type CallsStartResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion api/calls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
)

func TestVK_CallsStart(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/captcha_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
)

func TestVK_CaptchaForce(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/database.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// DatabaseGetChairsResponse struct.
Expand Down
2 changes: 1 addition & 1 deletion api/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"

"github.com/stretchr/testify/assert"
)
Expand Down
4 changes: 2 additions & 2 deletions api/docs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// DocsAdd copies a document to a user's or community's document list.
Expand Down
2 changes: 1 addition & 1 deletion api/docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion api/donut.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package api

import "github.com/SevereCloud/vksdk/v2/object"
import "github.com/SevereCloud/vksdk/v3/object"

// DonutGetFriendsResponse struct.
type DonutGetFriendsResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion api/donut_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
)

func TestVK_DonutGetFriends(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions api/downloadedGames.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// DownloadedGamesGetPaidStatusResponse struct.
Expand Down
2 changes: 1 addition & 1 deletion api/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"

"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

const errorMessagePrefix = "api: "
Expand Down
4 changes: 2 additions & 2 deletions api/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v2/streaming"
"github.com/SevereCloud/vksdk/v3/api"
"github.com/SevereCloud/vksdk/v3/streaming"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion api/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api_test
import (
"testing"

"github.com/SevereCloud/vksdk/v2/api"
"github.com/SevereCloud/vksdk/v3/api"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions api/fave.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package api // import "github.com/SevereCloud/vksdk/v2/api"
package api // import "github.com/SevereCloud/vksdk/v3/api"

import (
"github.com/SevereCloud/vksdk/v2/object"
"github.com/SevereCloud/vksdk/v3/object"
)

// FaveAddArticle adds a link to user faves.
Expand Down
Loading

0 comments on commit 30c8ba1

Please sign in to comment.