Skip to content

About

Cloudflare Workers-powered Telegram AI chat bot that leverages Google Gemini to deliver intelligent customer support. Built for speed, deployed globally, and designed for the modern web.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Ancient Chat

License: MIT Cloudflare Workers Built with Bun Vite+ GitHub last commit Commits

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.


Features

  • 🤖 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

Tech Stack

  • Runtime: Cloudflare Workers
  • Package Manager: Bun
  • Build Tool: Vite+
  • Testing: Vitest (node pool)
  • Linting/Formatting: Oxlint & Oxfmt
  • Language: JavaScript (ES Modules)

Quick Start

# Install dependencies
bun install

# Start local development
bun run dev

# Run tests
bun run test

# Deploy to Cloudflare
bun run deploy

Environment Variables

Copy .dev.vars.example to .dev.vars and fill in your keys:

API_KEY=your_telegram_bot_token

Scripts

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

Project Structure

├── src/               # Worker source code
├── tests/             # Vitest test files
├── wrangler.jsonc     # Cloudflare Workers configuration
└── vitest.config.js   # Vitest configuration

Contributing

Contributions are welcome! Open an issue or a pull request.

License

This project is licensed under the MIT License — see LICENSE for details.

About

Cloudflare Workers-powered Telegram AI chat bot that leverages Google Gemini to deliver intelligent customer support. Built for speed, deployed globally, and designed for the modern web.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages