telegant
Telegant
Telegant is a feature-rich Telegram bot framework specifically built for Crystal. Built with beauty and scalability in mind, it offers a simple syntax for creating complicated bot interactions while retaining Crystal's efficiency benefits.
π§© Features
- β¨ Elegant annotation-based API - Define handlers with Crystal annotations
- π‘οΈ Middleware system - Add customized logic, such as rate limitation, logging, or access restriction
- π Attachable middleware - Add middleware to specified handlers
- π Context - Easy access to the current update properties and API calls
- π State management - Integrated user state management for complicated interactions
- π Dialog management - Create multi-step conversations with built-in state management
π¨ Installation
Add Telegant to your shard.yml
:
telegant:
github: telegant/telegant
branch: release/v0.0.1
Then run:
shards install
π‘ Example
require "telegant"
class MyBot < Telegant::Bot
@[Hears("hi", "hello")]
def on_greet(update, bot)
bot.reply("Hey there!")
end
bot = MyBot.new("YOUR_BOT_TOKEN")
bot.start()
π Documentation
https://crystaldoc.info/github/Telegant/Telegant/main/index.html
β€οΈ Contribute
To-do
πΊοΈ Roadmap
To-do