Skip to content

Introduction

VibeGram is a lightweight, TypeScript-first Telegram Bot framework designed for production environments. It ships 20 built-in modules covering routing, state, security, webhooks, plugins, and broadcasting.

Why VibeGram?

This table compares how common bot-building features are packaged, not whether other frameworks can implement them at all. It was checked against grammy@1.44.0, telegraf@4.16.3, and their official docs on 2026-07-07; community packages outside the official docs are not exhaustively listed.

AreaVibeGramgrammYTelegrafRaw Bot API
Middleware pipelineCoreCoreCoreManual
TypeScript typesCoreCoreCoreManual
Session stateCore session()Built-in session pluginCore session()Manual
Conversation flowsCore Conversation, Scene, WizardOfficial @grammyjs/conversationsCore Scenes / WizardSceneManual
Incoming rate limitingCore rateLimit()Official @grammyjs/ratelimiterExternal middleware or customManual
Outgoing flood controlCore BotQueue; official @vibegram/throttlerOfficial @grammyjs/transformer-throttler + runnerExternal middleware or customManual
Interactive menusCore MenuOfficial @grammyjs/menuKeyboard primitives or external menu libsManual
Keyboard layout helpersCore Markup.grid()InlineKeyboard / Keyboard with row() / from()Markup.inlineKeyboard(..., { columns, wrap })Manual
API response cacheCore apiCache()Custom transformer or middlewareCustom middlewareManual
WebApp init-data validationCore HMAC helperCustom/manual validationCustom/manual validationManual
Webhook framework integrationExpress, Fastify, Hono, Koa, Native HTTP adapterswebhookCallback() for web frameworksWebhook launch/create helpers plus examplesManual
Error modelVibeGram error class hierarchyFramework error classesFramework error classesManual

References used for this comparison: grammY plugins, grammY sessions, grammY menus, grammY conversations, grammY rate limiter, grammY flood control, grammY webhook callback, Telegraf docs, Telegraf session, Telegraf WizardScene, and Telegraf inline keyboard.

Architecture Overview

text
Bot Instance
  TelegramClient (HTTP transport)
  Plugin System (BotPlugin + Preset)
  Composer (middleware stack)
    logger()
    dedupeUpdates()
    rateLimit()
    apiCache()
    session()
    filters, scenes, wizards, conversations, menus
    your handlers
  Context (per-update helpers)
  BotQueue (broadcasting + scheduling)
  Framework adapters (Express, Fastify, Hono, Koa, Native HTTP)

Built-in Modules (20)

ModuleDescription
BotEntry point with polling, webhooks, and plugin support
TelegramClientTelegram Bot API client with internal HTTP transport
ContextPer-update helper object with message, media, admin, and utility methods
ComposerMiddleware stack with use, command, on, hears, and action
MarkupKeyboard, grid, and safe escaping helpers
sessionTyped session store with adapter pattern
SceneNamed conversation state rooms
WizardLinear multi-step forms
ConversationAsync dialogue helpers with validation and timeouts
MenuStateful inline menus with sub-navigation
FiltersComposable update predicates
InlineResultsBuilder for inline query results
PluginBotPlugin, createPlugin, and Preset
BotQueueRate-limited broadcasting and scheduling
apiCacheTTL-based Telegram API response cache
rateLimitInbound anti-spam middleware
dedupeUpdatesDuplicate update dropper with memory or custom store
WebAppUtilsTelegram Mini App HMAC validation
I18nLocale detection and translation middleware
AdaptersExpress, Fastify, Hono, Koa, and Native HTTP webhook adapters

Bot API Coverage

VibeGram targets Telegram Bot API 10.1 with:

  • Context helpers for messages, media, admin, forums, business flows, checklists, stickers, gifts, and verification.
  • Strong TypeScript coverage for major Telegram objects.
  • Webhook adapters with secret-token validation and body limits.
  • Support for Telegram Stars, Draft Messages, Managed Bots, Rich Messages, Join Request Queries, and poll link media.

What's New in 2.5.0

  • Duplicate update protection with dedupeUpdates(), MemoryUpdateDedupeStore, and the vibegram/dedupe subpath.
  • Polling offset commit control with polling.offsetCommit: 'processed' for retrying failed updates before advancing offsets.
  • Response size limits with TelegramClientOptions.maxResponseBytes.
  • Safer command routing for bot mentions and command prefix collisions.
  • HTTP timeout coverage now includes body parsing and stream cleanup.
  • Queue and rate-limit options now fail fast on invalid numeric values.
  • Codex plugin Markdown interpolation is escaped for user-controlled values.
  • The security plugin now includes a production preset helper.

See the full CHANGELOG for release details.

Released under the ISC License.