An advanced Telegram bot by RexBots designed to save restricted content (Text, Media, Files) from both private and public channels. This bot supports batch downloading, user login via session strings, and advanced customization options.
- Save Restricted Content: Download text, media, and files from channels where saving is restricted.
- Batch Mode: Bulk download messages from a channel (Public/Private) using
/batch. - User Login: Login with your Telegram account using
/loginto enable downloading capabilities. - Customization:
- Set custom captions (
/set_caption). - Set custom thumbnails (
/set_thumb). - Auto-delete or replace specific words in filenames/captions.
- Set custom captions (
- Premium System: Built-in system for free and premium user plans.
- Admin Tools: Broadcast messages, ban/unban users, manage premium status.
- Persistent Storage: Uses MongoDB to store user data and settings.
- Keep-Alive: Built-in keep-alive mechanism for deployment on platforms like Render/Heroku.
- Python 3.10+
- MongoDB Database
- Telegram API ID and Hash
- Bot Token
To run the bot, you need to set the following environment variables:
| Variable | Description |
|---|---|
BOT_TOKEN |
Your Telegram Bot Token from @BotFather |
API_ID |
Your Telegram API ID from my.telegram.org |
API_HASH |
Your Telegram API Hash from my.telegram.org |
ADMINS |
Comma-separated list of Admin User IDs (e.g., 12345678,87654321) |
DB_URI |
Your MongoDB Connection String |
DB_NAME |
Database Name (default: SaveRestricted2) |
LOG_CHANNEL |
Channel ID for logging new users and errors |
ERROR_MESSAGE |
True or False (Send error messages to user) |
KEEP_ALIVE_URL |
URL to ping for keep-alive (optional) |
-
Clone the repository:
git clone https://github.com/abhinai2244/SAVE-RESTRICT-BOT.git cd SAVE-RESTRICT-BOT -
Install dependencies:
pip3 install -r requirements.txt
-
Run the bot:
python3 bot.py
docker build -t rexbots-save-content .
docker run -d --env-file .env rexbots-save-content/start- Start the bot/help- Get help information/login- Login to your account/logout- Logout from your account/cancel- Cancel ongoing batch process/settings- Open settings menu/myplan- Check your current plan status/premium- View premium plan details
/set_caption- Set a custom caption/see_caption- View your custom caption/del_caption- Delete your custom caption/set_thumb- Set a custom thumbnail (reply to photo)/view_thumb- View your custom thumbnail/del_thumb- Delete your custom thumbnail/thumb_mode- Toggle thumbnail mode (Custom/Default)/set_del_word- Set words to auto-delete/rem_del_word- Remove words from auto-delete list/set_repl_word- Set words to auto-replace/rem_repl_word- Remove replacement word pair/setchat- Set dump chat ID
/broadcast- Broadcast a message to all users/ban//unban- Manage user access/add_premium//remove_premium- Manage premium users/users- View total user count/premium_users- View active premium users/set_dump- Set dump chat for a user/dblink- Get database connection string
A huge thanks to the developers who made this project possible:
For queries, feature requests, or bug reports, join our official channel: