chatgpt-telegram-bot  by RainEggplant

Telegram bot for interacting with ChatGPT via Node.js

created 2 years ago
326 stars

Top 84.8% on sourcepulse

GitHubView on GitHub
Project Summary

This Node.js-based Telegram bot integrates with ChatGPT, offering flexibility through official, unofficial, and browser-based API options. It's designed for Telegram users seeking to leverage AI chatbots within their messaging platform, providing features like private and group chat support, message queuing, and customizable bot behavior.

How It Works

The bot supports three distinct API integration methods: the official OpenAI API (paid, robust), an unofficial proxy API (free, potentially rate-limited, relies on third-party servers), and a browser-based API (free, uses Puppeteer, considered flaky and heavyweight). This multi-API approach allows users to choose based on cost, reliability, and technical requirements, with a strong recommendation towards the official API due to potential account bans with unofficial methods.

Quick Start & Requirements

  • Install: pnpm install && pnpm build && pnpm start (Node.js) or docker run -d -v ./config:/app/config raineggplant/chatgpt-telegram-bot:latest (Docker).
  • Prerequisites: Node.js (v19+ recommended), pnpm, Chromium-based browser (for browser-based API), OpenAI API key or access token.
  • Setup: Requires configuration via config/local.json. Docker image for browser-based API is tagged latest-browser.
  • Docs: Usage section in README.

Highlighted Details

  • Supports private and group chats, with optional privacy mode.
  • Message queuing to avoid rate limits.
  • Customizable system messages for bot identity.
  • Cloudflare bypassing and CAPTCHA automation for browser-based API.

Maintenance & Community

  • Recent updates include per-chat conversation support and optional message queues.
  • Pre-built Docker image available on Docker Hub.

Licensing & Compatibility

  • MIT License. Permissive for commercial use and closed-source linking.

Limitations & Caveats

The README strongly advises against the browser-based API due to flakiness and potential errors. There are also rumors of OpenAI account bans for using unofficial or browser-based APIs, recommending users proceed at their own risk. Running the browser-based API on headless servers requires additional setup like Xvfb and potential CAPTCHA solving services.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.