A powerful Telegram bot that helps you store, organize, browse, share, and manage collections of media and text.
| Feature | Description |
|---|---|
| ๐ฆ Collections | Create and manage multiple media collections |
| โ๏ธ Media Storage | Store photos, videos, documents, audio, and text |
| ๐ Secure Sharing | Share collections via unique codes with access tracking |
| ๐ Batch Status | Real-time updates during mass uploads |
| ๐ก๏ธ Admin Panel | Full user management and analytics dashboard |
| ๐ Auto-Captions | Automatically saves captions with media |
| ๐๏ธ Browsing | Native Telegram UI for browsing stored content |
| โก Performance | Asynchronous design with flood protection |
git clone https://github.com/Omer-Dahan/Collections-bot
cd Collections-bot# Windows
python -m venv venv
venv\Scripts\activate
# Linux/macOS
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a config.py file based on the example below:
BOT_TOKEN = "your_bot_token_here"
ADMIN_IDS = [123456789] # List of admin Telegram IDs
# Optional custom settings
MAX_CAPTION_LENGTH = 800python bot.pyUsing the bot is simple and intuitive. Here is the basic workflow:
- Start: Send
/startto open the main menu. - Create Collection: Select "๐ New Collection", name it, and it will become "active".
- Save Content: Any message you send to the bot (photo, video, file, text) will be automatically saved to the active collection.
- Manage: Use the menus to browse, delete, or share your collections.
| Command | Description |
|---|---|
/start |
๐ Return to main menu and show status |
/new_collection |
๐ Create a new collection quickly (e.g. /new_collection MyTops) |
/list_collections |
๐ List your collections and select an active one |
/browse |
๐ Browse files stored in your collections |
/manage_collections |
โ๏ธ Advanced management (Delete, Export, Share) |
/remove |
๐๏ธ Activate single item deletion mode |
/id_file |
๐ Get the File ID of a file (Developer tool) |
/access |
๐ Access a shared collection via code (e.g. /access CODE123) |
graph TD
A[Start /start] --> B{Main Menu}
B -->|New Collection| C[Create Collection]
B -->|Select Existing| D[Set Active Collection]
B -->|Browse| E[View Items]
B -->|Manage| F[Options: Export/Delete/Share]
C --> G[๐ฅ Collecting Mode]
D --> G
G -->|User sends file| H[DB Store]
H -->|Feedback| G
F -->|Share| I[Generate Code]
I -->|Send to Friend| J[User B enters Code]
J --> E
Collections-bot/
โโโ ๐ bot.py # ๐ง Main bot entry point
โโโ ๐ admin_panel.py # ๐ก๏ธ Admin interface & stats
โโโ ๐ db.py # ๐๏ธ Database operations
โโโ ๐ utils.py # ๐ ๏ธ Helper functions
โโโ ๐ config.py # โ๏ธ Configuration (Sensitive)
โโโ ๐ handlers/ # ๐ฎ Logic handlers
โ โโโ ๐ commands.py # /start, /help, etc.
โ โโโ ๐ callbacks.py # Button interactions
โ โโโ ๐ messages.py # Media & text handling
โโโ ๐ constants.py # ๐ Constant values
โโโ ๐ message_tracker.py # ๐จ Message tracking
โโโ ๐ requirements.txt # ๐ฆ Dependencies
โโโ ๐ run_bot.bat # ๐ Windows runner
โโโ ๐ LICENSE.txt # ๐ GPL-3.0
โโโ ๐ README.md # You are here! ๐
The bot uses SQLite for efficient local storage. Tables are automatically created on first run:
- Collections: Stores collection metadata
- Items: Links media files to collections
- Users: User profiles and stats
- Shared_Collections: Active share codes and permissions
- Access_Logs: Tracks who accessed shared content
- ๐ Private by Default: Collections are private unless explicitly shared.
- ๐ Unique Codes: Sharing uses randomly generated unique access codes.
- ๐ซ Access Control: Owners can revoke share codes at any time.
- ๐ Logging: Comprehensive logging of user actions and errors.
Important
Telegram Limits: File uploads are subject to Telegram size limits (up to 2GB per file, or 4GB for Premium subscribers).
Warning
Data Privacy: The database (bot_data.db) is stored locally. Deleting this file will result in losing all collection data! Regular backups are recommended.
Tip
Efficiency: The bot stores only the File ID of files, not the files themselves, saving significant server storage and ensuring fast performance.
Note
Deletion: Deleting a message from the chat does not remove it from the bot's database. Use the bot's deletion tools to permanently remove items.
This project is licensed under GNU General Public License v3.0.
Any redistribution or modification must comply with the terms of this license.
This bot is intended for lawful use only. Responsibility for downloaded content and compliance with local laws and platform policies lies solely with the user.
Made with โค๏ธ by Omer