bot api reference

every Telegram Bot API method and type — 180 methods, 359 types, Bot API 10.1 — with a yaebal-specific usage example on every page. generated from packages/types/schema.json, the same single source of truth @yaebal/types and @yaebal/contexts are code-generated from — nothing here is hand-maintained, so it can't drift.

calling a method

three ways a method can end up typed, from most to least common — every method page below shows whichever apply:

bot.ts
import type { SendMessageParams, Message } from "@yaebal/types";

// every method: full params + return type, cross-linked to its own reference page
await bot.api.call<Message>("sendMessage", {
  chat_id: 123456789,
  text: "hello!",
} satisfies SendMessageParams);

// a growing subset also gets a direct typed shortcut on `Api`:
await bot.api.sendMessage({ chat_id: 123456789, text: "hello!" });

// ...and/or a context shortcut, wired by @yaebal/contexts:
bot.on("message", (ctx) => ctx.send("hello!"));

Getting updates

methods 4

types 2

Available types

types 227

Available methods

methods 131

Updating messages

methods 14

Stickers

methods 16

types 4

Rich messages

methods 2

types 53

Inline mode

methods 1

types 31

Payments

methods 8

types 25

Telegram Passport

methods 1

types 14

Games

methods 3

types 3