Telegram Bot API framework written in Crystal. Based heavily off of Telegraf this Crystal implementation allows your Telegram bot to be written in a language that's both beautiful and fast. Benchmarks coming soon.
If you want to extend your bot by using NLP, see my other library Cadmium.
Add this to your application's
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" class EchoBot < Tourmaline::Client @[Command("echo")] def echo_command(ctx) ctx.message.reply(ctx.text) end end bot = EchoBot.new(bot_token: ENV["API_KEY"]) bot.poll
This currently supports the following features:
- Client API
- Implementation examples
- Easy command syntax
- Robust middleware system
- Standard API queries
- Inline mode
- Long polling
- Telegram Passport
- HTTP/HTTP Proxies
If you want a new feature feel free to submit an issue or open a pull request.
Who's Using Tourmaline
If you're using Tourmaline and would like to have your bot added to this list, just submit a PR!
- Fork it ( https://github.com/protoncr/tourmaline/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- watzon Chris Watson - creator, maintainer
- 2 days ago
- February 13, 2018
Thu, 22 Jul 2021 23:49:29 GMT