chatgpt-telegram  by m1guelpf

Telegram bot CLI tool for ChatGPT interaction

created 2 years ago
3,909 stars

Top 12.7% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a self-hosted Telegram bot that allows users to interact with OpenAI's ChatGPT. It's designed for individuals who want a private, command-line interface to ChatGPT, accessible via Telegram, with a focus on ease of deployment.

How It Works

The bot is built as a Go CLI application. It leverages a browser-based authentication mechanism by default, launching a browser instance for users to log into their OpenAI account. Once authenticated, it captures the session token. Alternatively, users can manually extract their __Secure-next-auth.session-token cookie from their browser and provide it directly for headless or server-side operation. This approach offers flexibility for different deployment environments.

Quick Start & Requirements

  • Installation: Download the pre-compiled binary for your OS from the releases page.
  • Prerequisites: A Telegram Bot Token (obtainable via @BotFather on Telegram). Optionally, your Telegram User ID for restricted access.
  • Configuration: Rename env.example to .env and fill in TELEGRAM_TOKEN and optionally TELEGRAM_ID.
  • Running: Execute ./chatgpt-telegram in the terminal from the extracted directory.
  • Docker: docker pull ghcr.io/m1guelpf/chatgpt-telegram. Use docker-compose with a mounted .config/ volume containing chatgpt.json for session token.
  • Docs: https://github.com/m1guelpf/chatgpt-telegram

Highlighted Details

  • Single-command deployment via pre-compiled binaries.
  • Supports both automatic browser authentication and manual session token injection.
  • Optional Telegram User ID restriction for private bot usage.
  • Configurable edit wait time to mitigate request rate limits.

Maintenance & Community

The project appears to be maintained by m1guelpf. No specific community channels (Discord/Slack) or roadmap are explicitly mentioned in the README.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Permissive for commercial use and integration with closed-source applications.

Limitations & Caveats

The automatic browser authentication may not work in headless environments. Manual session token extraction is required for server-side deployments without a GUI. The README does not detail specific OpenAI API rate limits or costs associated with usage.

Health Check
Last commit

2 years ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.