Skip to content

About

Kotlin Multiplatform Telegram Client

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

TelegramClient for Kotlin Multiplatform

GitHub license Kotlin 2.4.20 Ktor 3.2.0

Kotlin Multiplatform Telegram Bot API client on top of the Ktor HttpClient. Published to Maven Central as pw.binom.telegram:telegramClient.

Русская версия

Install

dependencies {
    implementation("pw.binom.telegram:telegramClient:0.1.0")
    implementation("io.ktor:ktor-client-cio:3.2.0")
}

Use

val tg = TelegramClient.open(CIO, token = "<bot-token>")
tg.use {
    it.sendMessage(TextMessage(chatId = "1", text = "Hello, world!"))
}

TelegramClient is AutoCloseable. If you already maintain your own HttpClient, hand it to TelegramClient.wrap(http, token = "…") instead.

Targets

JVM, iOS (arm64 + simulator), macOS (arm64), Linux (x64 + arm64), Windows (mingw x64).

About

Kotlin Multiplatform Telegram Client

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages