A powerful Telegram bot that allows admins to store and share files with unique links and forced channel membership.
- 📁 File Storage: Store photos, videos, documents, and audio files
- 🔗 Unique Share Links: Generate
t.me/bot?start=6digitlinks for each file - 🔒 Forced Channel Membership: Users must join specified channels to access content
- 📝 Custom Captions: Add captions to shared files
- 🔘 Custom Buttons: Add buttons with URLs to shared files
- 📊 Statistics: Track file views and user statistics
- 👥 Admin Management: Multiple admin support
- 🗃️ JSON Database: Simple file-based storage
- Python 3.12 or higher
- A Telegram bot token from @BotFather
# Clone or download the project
cd store
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt- Edit
config.json:- Replace
YOUR_BOT_TOKEN_HEREwith your bot token - Add your user ID to
admin_idsarray - Configure
forced_channelswith your channel details - Set your
bot_username
- Replace
{
"bot_token": "1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",
"admin_ids": [123456789],
"forced_channels": [
{
"id": "@yourchannel",
"name": "Your Channel",
"invite_link": "https://t.me/yourchannel"
}
],
"bot_username": "your_bot_username"
}# Activate virtual environment
source venv/bin/activate
# Run the bot
python main.py/save -c <caption> -b <button_text> -u <url>- Save file with options (reply to media)/save- Quick save file (reply to media)/list- List your saved files/delete <code>- Delete a file by its 6-digit code/stats- View bot statistics/help- Show help message
-
Save a file with caption and button:
(Reply to a photo/video/document) /save -c Welcome to our channel! -b Visit Website -u https://example.com -
Quick save:
(Reply to any media) /save -
Delete a file:
/delete 123456
Files are shared using links in the format:
t.me/your_bot_username?start=123456
Users must join all configured channels before they can access the shared content.
store/
├── main.py # Main bot application
├── config_manager.py # Configuration management
├── database.py # JSON database operations
├── channel_checker.py # Channel membership verification
├── file_handler.py # File operations and admin commands
├── config.json # Bot configuration
├── store_data.json # Database file (auto-created)
├── requirements.txt # Python dependencies
├── pyproject.toml # Project configuration
└── README.md # This file
- Keep your bot token secure
- Only add trusted users as admins
- Regularly backup your
store_data.jsonfile - Monitor bot usage through the stats command
- Bot not responding: Check if the bot token is correct
- Channel check failing: Ensure the bot is admin in the channels
- Files not sending: Files may be deleted from Telegram servers
- Permission errors: Verify admin IDs in config.json
This project is open source. Feel free to modify and distribute.