com.github.stormbit.sdk.example.ExampleGroup.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vk-bot-sdk-kotlin Show documentation
Show all versions of vk-bot-sdk-kotlin Show documentation
The Kotlin library for working with VK api
package com.github.stormbit.sdk.example
import com.github.stormbit.sdk.clients.Group
import com.github.stormbit.sdk.utils.vkapi.keyboard.KeyboardBuilder
import org.apache.log4j.BasicConfigurator
/**
* Simple echo bot with keyboard
*/
class ExampleGroup {
companion object {
private const val token = "" // Your token
private const val id = 0 // Your group id
@JvmStatic
fun main(args: Array) {
BasicConfigurator.configure()
val client = Group(token, id)
client.onMessage {
client.sendMessage {
peerId = it.peerId
text = it.text
keyboard = KeyboardBuilder {
buttonsRow {
defaultButton("Press me!")
}
}.build()
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy