Hasty Briefsbeta

Bilingual

Telegram Serverless

6 hours ago
  • #bot-development
  • #backend-infrastructure
  • #telegram-serverless
  • Telegram Serverless allows running backend code for bots and Mini Apps directly on Telegram's infrastructure, eliminating the need for server provisioning, container management, or scaling concerns.
  • Developers write JavaScript modules, deploy them with a single command, and Telegram runs the code in an isolated V8 sandbox adjacent to the Bot API and a built-in database.
  • A project structure includes handlers for update types, lib for shared code, and schema.js for database tables, with modules imported by bare name and no npm packages at runtime.
  • Database interactions use a Drizzle-like query builder and schema DSL, with migrations handled separately via push for code and migrate for schema changes.
  • The SDK provides api for Bot API calls, fetch for HTTP requests, and console for logging, with handlers invoked per update type and testable via the run command.
  • The tgcloud CLI scaffolds projects, manages deployments, syncs with the cloud, and ensures concurrency checks to prevent overwrites in team environments.