Skip to content

Heapy/kotbot

Repository files navigation

kotbot Build

Bot API 7.9

Install library

implementation("io.heapy.kotbot:core:1.0.0")

Example

Execute a single method:

suspend fun main() {
    val kotbot = Kotbot(
        token = System.getenv("KOTBOT_TOKEN"),
    )

  kotbot.execute(GetMe())
      .also(::println)
}

Subscribe for updates:

suspend fun main() {
    val kotbot = Kotbot(
        token = System.getenv("KOTBOT_TOKEN"),
    )

    // Flow, which emits updates
    kotbot.receiveUpdates()
        .onEach(::println)
}