Skip to content

Telegram Bot API for TypeScript

Types auto-generated from the official Telegram documentation — 285 types and 166 methods, always up to date. Zero dependencies, typed results you can pattern-match on.

Features

Getting Started

Terminal window
# Full bot framework (includes client and types)
npm install @effect-ak/tg-bot
# HTTP client only
npm install @effect-ak/tg-bot-client
# Types only (zero runtime code)
npm install @effect-ak/tg-bot-api

Read the Introduction or jump to Quick Start to build your first bot in under 5 minutes.

Examples

Create a bot with command handling and text replies — no middleware, no boilerplate.

import { createBot } from "@effect-ak/tg-bot"
createBot()
.onMessage(({ command, text }) => [
command("/start", ({ ctx }) =>
ctx.reply("Hello! I'm your new bot.")
),
text(({ ctx }) =>
ctx.reply(`You said: ${ctx.update.message.text}`)
)
])
.run({ bot_token: "YOUR_BOT_TOKEN" })

Install with npm install @effect-ak/tg-bot — includes the client and all types.