A Cloudflare Workers-powered Telegram AI chat bot that runs on Cloudflare Workers AI to deliver intelligent customer support. Built for speed, deployed globally, and designed for the modern web.
- 🤖 AI-Powered Responses — Workers AI (Llama 3.2 1B Instruct) for smart, conversational replies
- ⚡ Streaming Replies — tokens stream live into a Telegram draft message (
sendRichMessageDraft) with a user-facing Stop button - 📐 Rich Markdown — replies ship as Bot API 10.1 Rich Messages (GitHub Flavored Markdown: lists, tables, code blocks, LaTeX), with a plain-text fallback
- ⚡ Edge-Runtime Performance — Deployed on Cloudflare Workers' global network
- 📱 Telegram Bot Integration — Webhook-based Telegram bot handling
- 🔒 Secure by Default — Environment-based API key management
- Runtime: Cloudflare Workers
- Package Manager: Bun
- Build Tool: Vite+
- Testing: Vitest (node pool)
- Linting/Formatting: Oxlint & Oxfmt
- Language: JavaScript (ES Modules)
# Install dependencies
bun install
# Start local development
bun run dev
# Run tests
bun run test
# Deploy to Cloudflare
bun run deployCopy .dev.vars.example to .dev.vars and fill in your keys:
API_KEY=your_telegram_bot_token| Command | Description |
|---|---|
bun run dev |
Start local development server |
bun run test |
Run Vitest suite |
bun run ui |
Open Vitest UI |
bun run deploy |
Deploy to Cloudflare Workers |
├── src/ # Worker source code
├── tests/ # Vitest test files
├── wrangler.jsonc # Cloudflare Workers configuration
└── vitest.config.js # Vitest configuration
Contributions are welcome! Open an issue or a pull request.
This project is licensed under the MIT License — see LICENSE for details.