- Bot framework built with Kotlin
- Inspired from Ktor - asynchronous Web framework for Kotlin
See mizoguche/botlin-template for example.
fun main(args: Array<String>) {
botlin {
install(SlackEngine) {
token = System.getenv("SLACK_TOKEN")
}
install(RedisStorage) {
uri = URI("redis://localhost:6379")
}
install(MessageCommand)
install(Echo)
install(Cron)
intercept<BotMessage> {
if (it.message == "PING") {
it.reply("PONG")
}
}
}.start()
}
- Readable configuration
- You can create your original feature easily
- You can adopt new web services as BotEngine easily
- BotEngine
- Providers which receives/sends messages
- ex. SlackEngine
- BotMessage
- Abstract expression of messages
- BotFeature
- Realize some useful features
- ex. Echo, Cron
- BotPipeline
- Any objects can flow through BotPipeline
- BotEngines send BotMessages to BotPipeline
- Objects flowing through BotPipeline are intercepted from BotFeature or Botlin configuration
- Any objects can flow through BotPipeline
MIT