GPT Telegram Worker banner
snakeying snakeying

GPT Telegram Worker

DevOps community intermediate

Description

A multi-model AI Telegram bot powered by Cloudflare Workers, supporting various APIs including OpenAI, Claude, and Azure. Developed in TypeScript with a modular design for easy expansion.基于 Cloudflare Workers 的多模型 AI Telegram 机器人,支持 OpenAI、Claude、Azure 等多个 API,采用 TypeScript 开发,模块化设计便于扩展。

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

🤖💬 Telegram GPT Worker - Multifunctional AI Assistant

[English](./README.md) | [简体中文](./docs/README.zh-cn.md) | [繁體中文](./docs/README.zh-hant.md) | [日本語](./docs/README.ja.md) | [Español](./docs/README.es.md) | [Français](./docs/README.fr.md) | [Русский](./docs/README.ru.md) | [Deutsch](./docs/README.de.md)

📖 Project Overview

Welcome to Telegram GPT Worker! 👋 This is an efficient Telegram bot developed in TypeScript. It supports multiple languages and AI models, deployed on Cloudflare Workers, providing users with a fast and scalable service experience.

🌟 Key Features

  1. 🧠 Multi-model Support: Integrates multiple AI models including OpenAI, Google Gemini, Anthropic Claude, Groq, and Azure OpenAI.
  2. 🔗 OpenAI Compatible Model Support: Designed specifically for AI model interface management and distribution systems such as One API and New API, supporting automatic model list retrieval.
  3. 💬 Intelligent Conversation: Equipped with context memory capability, ensuring smooth and natural dialogues.
  4. 🎨 Image Generation: Supports text-to-image generation using DALL·E and Cloudflare Flux technologies.
  5. 🖼️ Image Analysis: Allows users to upload images for intelligent analysis, using either OpenAI or Google Gemini models.
  6. 🌍 Multilingual Support: Built-in i18n functionality, supporting 8 languages to meet diverse needs.
  7. 🔒 User Permission Management: Controls access through whitelist functionality, enhancing security.
  8. ☁️ High-performance Deployment: Utilizes Cloudflare Workers' edge computing capabilities for rapid response.
  9. 🗄️ Efficient Data Management: Uses Redis for data caching and management, ensuring efficient processing.
  10. 🔧 Flux Prompt Optimization: Optional feature that optimizes image generation prompts for Flux model through an external API.

📋 System Requirements

Before getting started, please ensure you have the following:

  • Cloudflare account
  • Telegram account and Bot Token
  • Upstash Redis database (with Eviction feature enabled)
  • API key for at least one AI service

🚀 Quick Start

  1. Clone the project repository
  2. Configure necessary environment variables
  3. Deploy to Cloudflare Workers
  4. Set up Telegram Webhook

For detailed deployment steps, please refer to the tutorial below.

📝 Available Commands

  • /start - Start the bot
  • /language - Switch language
  • /switchmodel - Switch AI model
  • /new - Start a new conversation
  • /history - Get conversation history summary
  • /help - Get help information
  • /img - Generate image (DALL-E)
  • /flux - Generate image (Cloudflare Flux)

📁 Project Structure

/GPT-Telegram-Worker
│
├── /src
│   ├── /api
│   │   ├── azure.ts               # Handle Azure API interactions
│   │   ├── claude.ts              # Handle Claude API interactions
│   │   ├── flux-cf.ts             # Handle Clo