Go Telegram bot
FreeRun your own GPTChat Telegram bot, with a single command!
FreeFree tier
Inputs: textOutputs: text
About Go Telegram bot
chatgpt-telegram is an open-source Go CLI tool that creates a Telegram bot for interacting with OpenAI's ChatGPT. It allows users to self-host their own bot with a single command, supporting both browser-based login and manual session token authentication for signing into ChatGPT. The bot can be restricted to specific Telegram user IDs, includes configurable edit wait seconds to avoid rate limits, and is deployable via Docker. Built by m1guelpf, it provides a simple, free way to access ChatGPT through Telegram.
Key Features
Self-hosted Telegram bot for interacting with ChatGPT
Single-command setup using a precompiled binary
Docker support for server deployment
Optional Telegram ID restriction for private bot access
Configurable edit wait time to handle rate limits
Browser-based login or session token authentication
Cross-platform binaries for macOS, Linux, and Windows
Pros & Cons
Pros
- Free and open-source with MIT license
- Easy deployment with Docker or precompiled binaries
- Access control via Telegram user IDs for privacy
- No recurring subscription cost beyond OpenAI ChatGPT account
- Lightweight Go implementation with minimal dependencies
Cons
- Requires an active OpenAI ChatGPT account (may have usage limits)
- Self-hosting requires technical knowledge and a server or local machine
- Authentication setup may be non-trivial for non-technical users
- No official support or maintenance guarantee (single maintainer)
- Limited to Telegram platform only
Best For
Personal access to ChatGPT via Telegram on mobile or desktopPrivate bot for individual or team use with restricted accessDeploying a ChatGPT bot on a server for continuous availabilityExperimenting with OpenAI's language model through a chat interface
FAQ
How do I get a Telegram bot token?
Follow the official Telegram guide (linked in the repository) to create a bot and obtain the token from BotFather.
How does authentication work?
By default, the bot launches a browser for you to sign into your ChatGPT account. Alternatively, you can manually extract the __Secure-next-auth.session-token cookie from your browser and place it in a configuration file for headless/server use.
Can I restrict who uses the bot?
Yes, set the TELEGRAM_ID environment variable to your Telegram user ID (or multiple comma-separated IDs) to only allow specific users to interact with the bot.
How do I run the bot with Docker?
Pull the image from ghcr.io/m1guelpf/chatgpt-telegram and run it with docker-compose, mapping a volume that contains your chatgpt.json config file and setting the required environment variables.
What platforms are supported?
Precompiled binaries are available for macOS (Intel and ARM), Linux (AMD64 and ARM64), and Windows (AMD64). Docker images are also provided.