TeleGPT: An Advanced ChatGPT Bot for Telegram
TeleGPT is a robust and user-friendly Telegram bot designed to bring the capabilities of OpenAI's ChatGPT models directly to users on Telegram. This specialized bot leverages the power of the teloxide and async_openai frameworks, making it simple for anyone to interact with ChatGPT using their own API key.
Key Features
- Built for Speed: With a codebase crafted entirely in Rust, TeleGPT offers lightning-fast performance.
- Versatile Chat Support: It supports all types of chats, whether private or group.
- Real-Time Communication: Enjoy live streaming of responses directly into your message bubble.
- Markdown Rendering: Integrates with Telegram-flavored Markdown to enhance message formatting.
- Usage Tracking: Keeps a record of token usage, which users can query through specific commands.
- Customizable Settings: Offers comprehensive customization through a file-based configuration system.
- Admin Features (Beta): Provides admin functionality and user access control to tailor the bot’s use to your preferences.
Deployment Options
Using Docker
For those who prefer using Docker, TeleGPT offers a straightforward setup. It supports amd64 architecture machines through a prebuilt image available via the GitHub Container Registry.
- Authenticate with GitHub Container Registry using your credentials.
- Prepare a
config.json
file with necessary tokens:- Get a Telegram Bot token from Telegram's bot creation page.
- Acquire an OpenAI API token from OpenAI's API platform.
- Deploy the bot using the command line to start the Docker container.
Various helpful commands are available for managing the Docker deployment, like checking logs, stopping the container, and pulling the latest image.
Direct Download
For those testing or deploying without Docker, pre-built binaries are available for direct download from the releases page, supporting Linux and macOS platforms.
Building from Source
Alternatively, developers can build the bot from source by cloning the repository and executing a build command through Cargo, providing flexibility for customization and development.
How to Use
To get started with TeleGPT, create a configuration file with all the necessary settings and tokens. By default, the bot reads from telegpt.config.json
in the current directory but allows you to specify a different path if needed.
Once configured, initiate the bot with a simple start command and confirm it's running when you see the message “Bot is started.” For debugging, verbose logging can be enabled by setting an environment variable, but it's advisable to avoid this in production to protect user privacy.
Admin Controls (Beta)
TeleGPT comes with emerging admin features, allowing for member management and privacy settings. By default, the bot is public, but it can be set to private for exclusive group use, restricting interactions to admin-invited members only.
Database Management
TeleGPT uses SQLite to store runtime data. While default settings use an in-memory database, a persistent file-based option is recommended to maintain data integrity over restarts, particularly useful for storing user access information.
Future Development
The roadmap for TeleGPT is promising, with plans for additional features such as retry mechanisms, conversation presets, an enhanced admin interface, and remote control options via HTTP APIs.
Contribution Opportunities
The TeleGPT project embraces community involvement. Contributions through issues and pull requests are welcome, with existing discussions encouraged to guide new developments.
License
The project is open-source, available under the MIT license, encouraging widespread use and adaptation.
TeleGPT presents an exciting opportunity to enhance communication on Telegram with high-performing, customizable, and easy-to-deploy AI solutions.