All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.stormbit.sdk.example.ExampleGroup.kt Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
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