
Type-safe, coroutine-based Telegram Bot API client with auto-generated OpenAPI bindings, modular architecture, lifecycle-aware bot framework supporting long polling, webhooks, and lightweight HTTP client integration.
⚠️ Early Development Warning This project is still in its early stages of development and may contain critical bugs. Use at your own risk.
A Kotlin Multiplatform library for the Telegram Bot API. It provides type-safe, auto-generated API bindings from the Telegram Bot API OpenAPI specification using Ktorfit.
// build.gradle.kts
implementation("com.hiczp:telegram-bot-api-application:$version")import com.hiczp.telegram.bot.application.TelegramBotApplication
import com.hiczp.telegram.bot.application.dispatcher.handler.HandlerTelegramEventDispatcher
import com.hiczp.telegram.bot.application.dispatcher.handler.handling
import com.hiczp.telegram.bot.application.dispatcher.handler.command.commandEndpoint
suspend fun main() {
val routes = handling {
commandEndpoint("start") { replyMessage("Welcome!") }
commandEndpoint("ping") { replyMessage("pong") }
}
val app = TelegramBotApplication.longPolling(
botToken = "YOUR_BOT_TOKEN",
eventDispatcher = HandlerTelegramEventDispatcher(routes)
)
app.start()
app.join()
}| Module | Description |
|---|---|
:protocol |
Auto-generated Telegram Bot API definitions |
:client |
High-level HTTP client wrapper |
:application |
Bot framework with lifecycle management |
:application-updatesource-webhook |
Webhook update source |
| Platform | Support |
|---|---|
| JVM | ✅ |
| Android | ✅ |
| JS | ✅ |
| WASM | ✅ |
| Linux | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| iOS | ✅ |
| watchOS | ✅ |
| tvOS | ✅ |
| Android Native | ✅ |
Note: Tests only run on JVM and desktop native targets (Linux, macOS, Windows).
📚 Full documentation is available in the Wiki.
MIT License
⚠️ Early Development Warning This project is still in its early stages of development and may contain critical bugs. Use at your own risk.
A Kotlin Multiplatform library for the Telegram Bot API. It provides type-safe, auto-generated API bindings from the Telegram Bot API OpenAPI specification using Ktorfit.
// build.gradle.kts
implementation("com.hiczp:telegram-bot-api-application:$version")import com.hiczp.telegram.bot.application.TelegramBotApplication
import com.hiczp.telegram.bot.application.dispatcher.handler.HandlerTelegramEventDispatcher
import com.hiczp.telegram.bot.application.dispatcher.handler.handling
import com.hiczp.telegram.bot.application.dispatcher.handler.command.commandEndpoint
suspend fun main() {
val routes = handling {
commandEndpoint("start") { replyMessage("Welcome!") }
commandEndpoint("ping") { replyMessage("pong") }
}
val app = TelegramBotApplication.longPolling(
botToken = "YOUR_BOT_TOKEN",
eventDispatcher = HandlerTelegramEventDispatcher(routes)
)
app.start()
app.join()
}| Module | Description |
|---|---|
:protocol |
Auto-generated Telegram Bot API definitions |
:client |
High-level HTTP client wrapper |
:application |
Bot framework with lifecycle management |
:application-updatesource-webhook |
Webhook update source |
| Platform | Support |
|---|---|
| JVM | ✅ |
| Android | ✅ |
| JS | ✅ |
| WASM | ✅ |
| Linux | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| iOS | ✅ |
| watchOS | ✅ |
| tvOS | ✅ |
| Android Native | ✅ |
Note: Tests only run on JVM and desktop native targets (Linux, macOS, Windows).
📚 Full documentation is available in the Wiki.
MIT License