Simple Telegram bot library for Crystal
Telegram Bot API library written in Crystal. Meant to be a simple, easy to use, and fast library for writing Telegram bots.
Add this to your application's shard.yml
:
dependencies:
tourmaline:
github: protoncr/tourmaline
branch: master
API documentation is also available here.
Examples are available in the examples folder.
Just for README purposes though, let's look at the echo bot example:
require "tourmaline"
client = Tourmaline::Client.new(ENV["BOT_TOKEN"])
echo_handler = Tourmaline::CommandHandler.new("echo") do |ctx|
text = ctx.text.to_s
ctx.reply(text) unless text.empty?
end
client.register(echo_handler)
client.poll
The following features are/will be implemented:
If you want a new feature feel free to submit an issue or open a pull request.
Thanks to all the people that have contributed to this project!