Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1022 Bytes

README.md

File metadata and controls

43 lines (32 loc) · 1022 Bytes

kotbot Build

Bot API 8.1

Install library

implementation("io.heapy.kotbot:core:1.2.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)
}