Create a chat-bot for VK.com in a few lines of code, use the API and forget about the limitations
Unofficial VK.com SDK
See the documentation: https://vksdk.github.io/vk-sdk-kotlin
int groupId = 151083290;
String accessToken = "abcdef123456...";
int userID = 123456789;
Group group = new Group(groupId, accessToken);
//Send message with keyboard
Message msg = new Message().from(group).to(userID).text("Some text").keyboard(new Keyboard().setInLine(true).addButtons(0, new Button().setLabel("Some button").setColor(Color.Positive)));The primary goal of the library is to cover most of the possible needs but in an abstract way. You can't find here a hundred of pre-defined data classes for each API method, but you can write the highly customizable solution in most convenient way.
- Supported platforms: JVM (+ Android), JS, darwin (iOS, macOS, tvOS, watchOS), mingwX64 (Windows), linuxX64
- Big and detailed examples: Multiplatform project (iOS & Android), Kotlin project, Java-only project. See the
examplesdirectory and the documentation. - Written in Kotlin, but has JVM-friendly API with methods overloading, static methods, etc.
- Modularized and highly customizable: use pre-defined HTTP-clients or write your own; combine API calls, make queues or calls lists, etc.
- Use the client created from the
codeor fromaccess_token. - Bots Long Poll API
- Event is a data class
MessageNewformessage_newevent - and the
JsonElementfor all the other events
- Event is a data class
- Batch requests queue using execute method under the hood: make up to 75+ requests per second and don't think about the VK API limitations
- Putting into batch requests queue is optional, but done by default for asynchronous requests
- Synchronous calls always sent immediately
- API calls:
- Synchronous
- Asynchronous (using callbacks)
- Using Kotlin Coroutines Flow wrapper
messages.send: use DSL for sending messages and building keyboards. All method capabilities are covered.- Attach files in a couple of lines of code, using a file from disk, URL, etc.
See the License