Skip to content

Yura2108/VkAPI

Repository files navigation

VK SDK Java

RECHANGE PETERSAMOKHIN KOTLIN SDK

Create a chat-bot for VK.com in a few lines of code, use the API and forget about the limitations


Build Documentation Kotlin 1.4.10 API version GitHub license

Unofficial VK.com SDK

See the documentation: https://vksdk.github.io/vk-sdk-kotlin

Minimal example of the echo-chatbot

Keyboard support was added

Java

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)));

Features

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 examples directory 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 code or from access_token.
  • Bots Long Poll API
    • Event is a data class MessageNew for message_new event
    • and the JsonElement for all the other events
  • 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:
  • 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.

License

See the License

About

Simple & custom vk api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages