packages
yaebal is a pnpm monorepo. three foundation packages, a stack of first-party plugins, plus scaling
and tooling — all under the @yaebal/* npm scope, published as ESM with full TypeScript
types.
# install everything (workspace bootstrap)
pnpm install
# or add individual packages to your project
pnpm add @yaebal/core @yaebal/session @yaebal/keyboardfoundation
| package | description |
|---|---|
yaebal | batteries-included entry — core + auto-generated contexts + common plugins, one import |
@yaebal/core | Bot, Composer, context, filter queries, media helpers — the engine everything else builds on |
@yaebal/types | full Telegram Bot API types, code-generated from the ark0f schema; single source of truth for all interfaces |
@yaebal/contexts | per-update context classes with auto-generated shortcut methods (ctx.reply, ctx.sendPhoto, …) |
plugins
each plugin is a typed composer extension. installing one enriches the context type; its dependencies are checked at compile time. see the plugins overview for a quick orientation.
| package | description |
|---|---|
@yaebal/fmt | html`` / md`` tagged templates → entities, with auto-escaped interpolation |
@yaebal/filters | composable, type-narrowing update filters (and / or / not) |
@yaebal/conversation | await-style multi-step dialogs (coroutine, no replay) |
@yaebal/again | auto-retry on 429 / flood-wait / transient 5xx errors |
@yaebal/session | per-chat session with pluggable storage adapters |
@yaebal/keyboard | fluent inline & reply keyboard builders |
@yaebal/callback-data | typed callback_data pack / unpack |
@yaebal/morda | dialogs engine + jsx/hooks (react-for-telegram) |
@yaebal/i18n | per-chat locale, ctx.t / ctx.changeLanguage |
@yaebal/scenes | step-by-step wizards over multiple messages |
@yaebal/prompt | ask a question, await the next message as the answer |
@yaebal/router | file-based routing from a routes/ directory |
@yaebal/throttle | rate-limit outgoing API calls |
@yaebal/files | resolve and download Telegram files |
@yaebal/ratelimiter | drop updates from users who send too many requests |
@yaebal/broadcast | send a message to many chats |
@yaebal/web | run your bot on edge/web runtimes (Cloudflare Workers, Deno, Bun) via webhooks |
@yaebal/panel | operator panel — view chats and reply from the browser |
@yaebal/media-group | collect album updates into one handler |
@yaebal/split | break long messages into Telegram-sized chunks |
@yaebal/commands | one registry for handlers + the / command menu |
@yaebal/pagination | paginated lists with inline prev/next buttons |
@yaebal/media-cache | reuse a file_id instead of re-uploading the same file |
scaling & tooling
| package | description |
|---|---|
@yaebal/runner | concurrent update processing with per-chat sequentialization |
@yaebal/workers | worker_threads pool to offload CPU-heavy tasks from handlers |
create-yaebal | project scaffolder — pnpm create yaebal my-bot |
all packages require Node.js ≥ 20 and are ESM-only (
"type": "module"). use import type for type-only imports — verbatimModuleSyntax is enabled
across the workspace.