Clabo is DSL (Domain-Specific Language) for Kotlin which gives you the easiest way to create bot for Telegram messenger.
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}"
}
}
}
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.
Clabo is developed by Ivan Osipov as free and open source project.
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 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.
Openness for the dialog opens door for contribution to this project. More information about code of conduct you can find here.
Clabo is Open Source which is licensed under the Apache Licenses, version 2.0. It can be freely used in commercial projects.
In this project there is usage of the next libraries:
- 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)
- Logback 1.2.3 - Logging (Eclipse Public License v1.0)