grammY

The modern TypeScript framework for building Telegram bots on Node.js and Deno

Framework
npm
v1.45.1
3,720stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
81/100Excellent
Development Activity80
Maintenance88
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture86
Code Quality84
Innovation80
Learning Curve78

grammY is a middleware-based framework for building Telegram bots in TypeScript or JavaScript. It wraps the full Telegram Bot API in a typed Context object and a Koa/Express-style Composer chain, letting bots be built as a pipeline of small, testable middleware functions instead of one large update handler.

It runs unmodified on Node.js, Deno, and Bun, and ships a large first-party plugin ecosystem (sessions, conversations, rate limiting, files, runner for scaling long polling) maintained under the same grammyjs organization, making it the most actively maintained Telegram bot framework in the JavaScript ecosystem.

What You Get

  • A Bot class handling long polling or webhook-based update delivery
  • A Composer/middleware system (bot.use(), bot.on(), bot.command(), bot.filter()) for organizing handlers
  • A fully-typed Context object exposing update data plus shortcut reply/API methods
  • Cross-runtime builds for Node.js, Deno, and browser/edge (Cloudflare Workers) environments
  • An official plugin ecosystem (@grammyjs/session, conversations, runner, ratelimiter, files) for common bot needs

Common Use Cases

  • Building production Telegram bots with structured, testable middleware pipelines
  • Deploying bots to serverless/edge platforms like Cloudflare Workers via the web build target
  • Scaling bots that need to process high update volume using the runner plugin’s concurrent long-polling
  • Stateful bots (multi-step forms, wizards) via the conversations plugin’s sequential flow API

Under The Hood

Architecture: The core lives in src/, centered on bot.ts (update loop and API client wiring), composer.ts (the middleware chaining engine implementing .use, .on, .command, .filter with the filter.ts predicate system), and a large context.ts (4,800+ lines) that flattens every Telegram Bot API method and update field onto one ergonomic Context object; src/core/ holds the low-level client.ts/api.ts/payload.ts that talk to the Telegram Bot API over HTTP. Platform-specific entry points (platform.node.ts, platform.deno.ts, platform.web.ts) isolate the few runtime differences (fetch, AbortController, file handling) so the same middleware code runs everywhere. Tech Stack: Written in TypeScript against the Deno runtime first, then back-compiled to Node.js via deno2node; runtime dependencies are minimal (@grammyjs/types for Bot API types, debug, node-fetch, abort-controller), keeping the core dependency-light. Code Quality: An 18-file test/ suite (Deno’s built-in test runner) covers the composer/middleware chain, context helpers, and API client behavior; the project has shipped 88 tagged releases with a steady ~6 commits/month cadence and strict TypeScript throughout. API Design: The middleware model (bot.on('message:text', ctx => ...)) mirrors Express/Koa conventions familiar to JS/TS developers, and the typed Context (auto-completing every Bot API field and shortcut method in an editor) minimizes the boilerplate of looking up raw Telegram API responses.

Used by 5 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
93%
Apache 2.0

flue

AI Agents · Developer Tools

7,953

Build autonomous AI agents and powerful workflows with a programmable TypeScript harness that gives any model sessions, tools, sandboxes, and durable execution.

View details
67
Repo Health
82
Technical
75
Dependency
Built with
TypeScript93%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

letta-code

AI Code Assistants · AI Assistants

3,050

A memory-first coding agent harness that learns from experience, maintains identity across models, and works across Claude, GPT, Gemini, and dozens more LLMs.

View details
84
Repo Health
84
Technical
78
Dependency
Built with
TypeScript98%
Updated today
TypeScript
77%
MIT

openwork

AI Assistants · Automation

22,642

OpenWork is a free, open-source desktop app for running AI agent workflows on your own files with 50+ LLMs, extensible skills, and MCP server support — the open-source alternative to Claude Cowork and Codex.

View details
84
Repo Health
89
Technical
68
Dependency
Built with
TypeScript77%
JavaScript20%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search