Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/protoncr/tourmaline
Simple Telegram bot library for Crystal
https://github.com/protoncr/tourmaline
bot crystal middleware rest-api stickers telegraf telegram telegram-bot telegram-bot-api telegram-bots telegram-channel telegram-cli telegrambot tourmaline webhook webhooks
Last synced: 1 day ago
JSON representation
Simple Telegram bot library for Crystal
- Host: GitHub
- URL: https://github.com/protoncr/tourmaline
- Owner: protoncr
- License: mit
- Created: 2018-02-13T01:26:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-30T01:24:48.000Z (about 1 month ago)
- Last Synced: 2024-10-30T03:57:03.946Z (about 1 month ago)
- Topics: bot, crystal, middleware, rest-api, stickers, telegraf, telegram, telegram-bot, telegram-bot-api, telegram-bots, telegram-channel, telegram-cli, telegrambot, tourmaline, webhook, webhooks
- Language: Crystal
- Homepage: https://tourmaline.dev
- Size: 30.5 MB
- Stars: 159
- Watchers: 4
- Forks: 39
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - tourmaline - Telegram bot framework with an API loosely based on [telegraf.js](https://telegraf.js.org/) (Framework Components)
- awesome-crystal - tourmaline - Telegram bot framework with an API loosely based on [telegraf.js](https://telegraf.js.org/) (Framework Components)
README
# Tourmaline
[![Chat on Telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/protoncr)
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`:
```yaml
dependencies:
tourmaline:
github: protoncr/tourmaline
branch: master
```## Usage
API documentation is also available [here](https://tourmaline.dev/api_reference/Tourmaline/).
Examples are available in the [examples](https://github.com/protoncr/tourmaline/tree/master/examples) folder.
Just for README purposes though, let's look at the echo bot example:
```crystal
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?
endclient.register(echo_handler)
client.poll
```## Roadmap
The following features are/will be implemented:
- [x] HTTP/HTTP Proxies
- [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
- [ ] Framework Adapters
- [ ] Kemal
- [ ] Amber
- [ ] Lucky
- [ ] Athena
- [ ] GripIf you want a new feature feel free to submit an issue or open a pull request.
## 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
Thanks to all the people that have contributed to this project!
[![Contributors](https://contrib.rocks/image?repo=protoncr/tourmaline)](https://github.com/protoncr/tourmaline/graphs/contributors)