Skip to content

ktgram is a modern and fully asynchronous framework for Telegram Bot's implementing the Telegram Bot API with kotlin

License

Notifications You must be signed in to change notification settings

lavafrai/ktgram

Repository files navigation

ktgram

ktgram is a modern and fully asynchronous framework for Telegram Bot's implementing the Telegram Bot API with kotlin.

Features

Simple

You can run a simple echo bot with just a few lines of code.

import ru.lavafrai.ktgram.client.Bot
import ru.lavafrai.ktgram.dispatcher.Dispatcher
import ru.lavafrai.ktgram.dispatcher.dsl.text


fun main() {
    val bot = Bot("<Your token>")

    val dispatcher = bot.dispatcher
    dispatcher.routing {
        text {
            handle {
                update.message!!.reply("You said: ${message.text}")
            }
        }
    }

    bot.runPolling()
}

Installation

Add the following to your build.gradle.kts file:

repositories {
    maven("https://jitpack.io")
}

dependencies {
    implementation("com.github.lavafrai:ktgram:$ktgramVersion")
}

Roadmap

  • Basic functionality
  • State machine
  • Middlewares
  • Integrated i18n
  • Documentation
  • Keyboards DSL
  • Payments support

Thanks

  • aiogram for idea to implement the same functional framework for kotlin and some architecture solutions.
  • kotlin-telegram-bot for some realization ideas.

About

ktgram is a modern and fully asynchronous framework for Telegram Bot's implementing the Telegram Bot API with kotlin

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages