yaebal
type-safe · chainable · plugin-first

yaebal

yet another telegram bot api library.
the context type accumulates through the chain — handlers see what plugins added, with zero casting.

$ pnpm add @yaebal/core
bot.ts
import { Bot } from "@yaebal/core";
import { session } from "@yaebal/session";

const bot = new Bot(process.env.BOT_TOKEN!)
  .install(session()) // ctx.session is now typed
  .derive((ctx) => ({ now: Date.now() }));

bot.on("message:text", (ctx) => {
  //                    ^ context is narrowed to text messages
  ctx.reply("hi " + ctx.from.first_name);
  ctx.react("🔥"); //   ^ auto-generated shortcut
});

bot.start();

type-safe

strict mode, no any in public types. the context type flows through the whole chain.

chainable

Bot extends Composer. derive / decorate / guard each return an augmented context type.

auto-gen contexts

every per-update context and its shortcut methods are generated from the Bot API schema.

plugin-first

a deep set of first-party plugins — filters, conversation, runner, and more. dependencies are explicit and type-checked, never implicit order.

MIT · built on the shoulders of grammY, GramIO & puregram