Skip to content

ChatGPT-Telegram-Workers

TrendingActive
tbxark/ChatGPT-Telegram-Workers

A simple and fast way to deploy your own ChatGPT Telegram bot on Cloudflare Workers

View on GitHub
Stars
3.8k
Forks
892
Watchers
3.8k
Open issues
15

The simplest and fastest way to deploy your own ChatGPT Telegram bot. Use Cloudflare Workers, single file, copy and paste directly, no dependencies required, no need to configure local development environment, no domain name required, serverless.

Core Features

  • Serverless Deployment: Deploy directly on Cloudflare Workers with zero configuration
  • Multi-Platform Support: Works on Cloudflare Workers, Vercel, Docker, and more
  • Multiple AI Providers: Supports OpenAI, Azure OpenAI, Cloudflare AI, Cohere, Anthropic, Mistral, DeepSeek, Gemini, Groq, and more
  • Interactive Features:
    • Model switching with inline keyboards
    • Custom commands for quick model switching and bot presets
    • Support for multiple Telegram bots
    • Streaming output for real-time responses
  • Advanced Features:
    • Multi-language support
    • Text-to-image generation
    • Plugin system for custom extensions
    • Customizable system initialization

Quick Start

  1. Fork the Repository:

    git clone https://github.com/TBXark/ChatGPT-Telegram-Workers.git
  2. Deploy to Cloudflare Workers:

    • Create a new Cloudflare Workers project
    • Copy the worker code
    • Configure your environment variables
    • Deploy!
  3. Configure Your Bot:

    • Get your Telegram bot token from @BotFather
    • Set up your AI provider credentials
    • Customize bot settings

Configuration

Environment Variables

TELEGRAM_BOT_TOKEN=your_bot_token
OPENAI_API_KEY=your_openai_key

Custom Commands

/start - Start the bot
/help - Show help information
/settings - Configure bot settings
/model - Switch AI models

Development

Requirements

  • Node.js 16+
  • Cloudflare account
  • Telegram bot token
  • AI provider API key

Local Development

  1. Install dependencies:

    npm install
  2. Start development server:

    npm run dev

Deployment Options

Cloudflare Workers

  • Zero configuration
  • Serverless
  • Global distribution

Vercel

  • Easy deployment
  • Automatic HTTPS
  • Custom domains

Docker

  • Containerized deployment
  • Easy scaling
  • Environment isolation

Support

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

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

Similar open-source projects, ranked by shared categories and tags.