Repository navigation
A large, fully backward-compatible release. 858 tests pass, luacheck clean. Built in five reviewed tranches, then put through a multi-agent adversarial review and an end-to-end mock-Telegram integration test before release.
Framework layer (new)
- Command router:
api.command('start', handler), guarded commands ({ guard = fn }),api.hears(pattern, handler),api.on_command_not_found(handler). - Rich context:
api.build_context(update)withctx.reply/reply_with_photo/answer/session/args/chat/from. - Sessions: per-chat/user store with pluggable backends (
api.session.get/set/clear/use). - Conversations:
api.conversation(name, fn)+api.enter(fn, update)withctx.wait_for()— works in sync (coroutine) and async (copas mailbox) modes.
Production robustness
- Automatic 429 /
retry_afterflood-control with bounded exponential backoff (async usescopas.sleep). - 409 conflict detection in the polling loops.
- Webhook receiver:
api.webhook.process(body, opts)for bring-your-own-server,api.webhook.serve(opts)turnkey copas server — with token verification. - Structured logging + metrics:
api.log.{debug,info,warn,error}(configurable sink/level),api.metrics.
API completeness (Bot API 10.1)
- 29 new methods: business accounts (12), gift lifecycle (transfer/upgrade/convert/gift-premium), stories (post/edit/delete), verification, subscription invite links,
get_my_star_balance,edit_message_checklist,save_prepared_inline_message,set_user_emoji_status. - New builders:
reaction_type_paid, reply-keyboard request buttons,input_poll_option, paid-media/story-content/profile-photo inputs, checklist builders,copy_text_button, and more. direct_messages_topic_id/suggested_post_parametersadded to the send/forward/copy methods.
Adapters
- LLM tool/function calling + bounded retry + no caller-mutation; redis reconnect +
scan; sqlite prepared-statement cache; email attachments.
Bug fixes
- Poll loops
pairs→ipairs(no duplicate processing); sync dispatch is nowpcall-guarded;on_guest_messagerouted;fmt.codemarkdown escaping; request layer no longer mutates the caller's table; async multi-file uploads fixed; async conversation timeout fixed.
Fully backward compatible — existing on_message/on_* handlers are unchanged. Bot API 10.1.
Install: luarocks install telegram-bot-lua