Type-safe TypeScript SDK for building Telegram bots, automatically generated from official Telegram Bot API documentation.
This monorepo contains three packages:
TypeScript types for Telegram Bot API and Mini Apps, auto-generated from official documentation.
Lightweight HTTP client for Telegram Bot API with full type safety.
Bot framework with fluent builder API, long polling, webhooks, and hot reload.
npm install @effect-ak/tg-botimport { createBot } from "@effect-ak/tg-bot"
await createBot()
.onMessage(({ command, text }) => [
command("/start", ({ ctx }) => ctx.reply("Welcome!")),
text(({ update, ctx }) => ctx.reply(`You said: ${update.text}`))
])
.run({ bot_token: "YOUR_BOT_TOKEN" })npm install @effect-ak/tg-bot-clientimport { makeTgBotClient } from "@effect-ak/tg-bot-client"
const client = makeTgBotClient({
bot_token: "YOUR_BOT_TOKEN"
})
await client.execute("sendMessage", {
chat_id: "123456789",
text: "Hello, World!"
})- Always Up-to-Date: Types generated from official Telegram API documentation
- Fully Type-Safe: Complete TypeScript support for all API methods and types
- Zero Config: Works out of the box with sensible defaults
- No Webhooks Required: Uses long polling - run anywhere without public URLs
Full documentation and API reference: tg-bot-sdk.website
Try it in your browser: Telegram Bot Playground
pnpm install
pnpm buildPush to main triggers two GitHub Actions workflows:
- Build — runs
pnpm build,pnpm typecheck, andpnpm test - Release — runs after a successful Build, uses changesets to version and publish packages to npm
To release a new version:
- Create a changeset:
pnpm changeset - Commit the generated changeset file and merge to
main - The Release workflow will open a "Release" PR that bumps versions
- Merge the PR — packages are automatically published to npm
Packages are published with npm provenance via OIDC between GitHub Actions and npm, so every published version is cryptographically signed and linked back to its source commit and workflow run.