Skip to content
Kotlin library for the easiest way to develop Telegram bot based on flexible DSL
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
.travis.yml
CNAME
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
NOTICE
README.md
_config.yml
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Clabo

license Build Status Chat Maven Central

Clabo is DSL (Domain-Specific Language) for Kotlin which gives you the easiest way to create bot for Telegram messenger.

Usage

If you use Gradle, you should add the follow config

repositories {
    jcenter()
}
dependencies {
    compile("org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version", //probably, you have the kotlin stdlib dependency
            'com.github.ivan_osipov:clabo:0.0.1', //the clabo dependency
            'ch.qos.logback:logback-classic:1.2.3', //any implementation of logging for slf4j
            'ch.qos.logback:logback-core:1.2.3')
}

The easiest sample of bot that you can implement below. You should change 'apiKey' with your value

fun main(args: Array<String>) {
    bot("apiKey") longPolling {
        onStart { command ->
            command.message answer "Hi, ${command.message.from}"
        }
    }
}

The Main Idea

I believe automatization moves the world forward. I believe that a business which really helps people at same time does them happier. I see that support teams, shops and different services which work with bots really simplify life of them customers and I want to see the same convenient customer service everywhere and this project is my contribution in shared interest.

Author

Clabo is developed by Ivan Osipov as free and open source project.

Contribution

There are many features which should be supported. If you have ideas about better DSL, please, feel free to create an issue with a description of your thought and it will be discussed. If you have some code with a new part of DSL, good changes in internal code or fixes for docs, please, feel free to do pull request. More information about contribution you can find in contribution guidelines for this project

Kotlin and Java

Kotlin gives us ability for making projects which will be started on JRE 6. Sometimes there are limitations for launching applications in JRE 8 in production. This project is compiled for JRE 6 and compatible with higher versions as result.

Code Of Conduct

Openness for the dialog opens door for contribution to this project. More information about code of conduct you can find here.

License

Clabo is Open Source which is licensed under the Apache Licenses, version 2.0. It can be freely used in commercial projects.

Dependencies

In this project there is usage of the next libraries:

Directly in library

  • Fuel 1.7.0 - The easiest HTTP networking library for Kotlin/Android (MIT License)
  • Gson 2.8.0 - A Java serialization/deserialization library to convert Java Objects into JSON and back (Apache 2.0 License)
  • Slf4j-Api 1.7.25 - The Simple Logging Facade for Java (MIT License)
  • Guava 22.0 - Google Core Libraries for Java (Apache 2.0 License)

In test runtime

You can’t perform that action at this time.