tourmaline

0.28.0 Latest release released
protoncr/tourmaline
161 38 4
protoncr
tourmaline logo

Tourmaline

Chat on Telegram

Telegram Bot API library written in Crystal. Meant to be a simple, easy to use, and fast library for writing Telegram bots.

Installation

Add this to your application's shard.yml:

dependencies:
  tourmaline:
    github: protoncr/tourmaline
    branch: master

Usage

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

Development

This currently supports the following features:

  • [x] Client API
    • [x] Implementation examples
    • [x] Handlers for commands, queries, and more
    • [x] Robust middleware system
    • [x] Standard API queries
    • [x] Stickers
    • [x] Inline mode
    • [x] Long polling
    • [x] Webhooks
    • [x] Payments
    • [x] Games
    • [x] Polls
    • [x] Telegram Passport
  • [x] 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!

Contributing

  1. Fork it ( https://github.com/protoncr/tourmaline/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • watzon Chris Watson - creator, maintainer
tourmaline:
  github: protoncr/tourmaline
  version: ~> 0.28.0
License MIT
Crystal >= 1.6.0

Authors

Dependencies 3

  • db ~> 0.11.0
    {'github' => 'crystal-lang/crystal-db', 'version' => '~> 0.11.0'}
  • html5 ~> 0.4.0
    {'github' => 'naqvis/crystal-html5', 'version' => '~> 0.4.0'}
  • http_proxy master
    {'branch' => 'master', 'github' => 'mamantoha/http_proxy'}

Development Dependencies 4

  • kemal
    {'github' => 'kemalcr/kemal'}
  • mosquito ~> 0.11.0
    {'github' => 'mosquito-cr/mosquito', 'version' => '~> 0.11.0'}
  • ngrok 0.3.1
    {'github' => 'watzon/ngrok.cr', 'version' => '0.3.1'}
  • spectator~icy-arctic-fox ~> 0.11.3
    {'github' => 'icy-arctic-fox/spectator', 'version' => '~> 0.11.3'}

Dependents 0

Other repos 1

Last synced .
search fire star recently