Premium Multi-User Telegram FileStore Bot Platform
Create, manage, and scale your own FileStore bots from a single controller.
| Feature | Description |
|---|---|
| 🤖 Multi-User Bot Creation | Users create their own FileStore bots via inline buttons |
| 📂 File Storage & Sharing | Store files in channels and share via deep-link URLs |
| 🔗 Force Subscribe | Join & Request modes with multiple channels per bot |
| 💰 URL Shortener | Compatible link monetization per bot |
| 👥 Admin Management | Add/remove admins per bot |
| ⏱ Auto-Delete Timer | Files auto-delete after a configurable time |
| 📩 Custom Start Message & Photo | Bot owners personalize their bot's welcome screen |
| 📝 Custom Captions | Set formatted custom captions and placeholders per bot |
| 📢 Broadcast System | Main bot and worker bots can broadcast messages to users |
| 🛡️ Content Protection | Toggle anti-forwarding to protect your shared files |
| 🚫 Ban / Unban Users | /ban and /unban commands for both main & worker bots |
| 🔗 Formatted Link Generator | /flink command for batch link formatting |
| 📦 Data Transfer | Transfer users, admins & settings from a deleted bot to a new one |
| 💤 Auto-Hibernation | Bots idle for 48+ hours are automatically stopped to save RAM |
| 🔐 Owner Panel | Secret /check command to inspect all bots, tokens & owners |
┌──────────────────────────────────────┐
│ Main Controller Bot │
│ /start • Create Bot • My Bots │
│ Force-Sub Gate (@cantarellabots) │
└──────────────┬───────────────────────┘
│ manages
┌──────────┼──────────┐
▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐
│Worker 1│ │Worker 2│ │Worker N│ ← Pyrogram Clients
│ @bot_a │ │ @bot_b │ │ @bot_n │
└───┬────┘ └───┬────┘ └───┬────┘
│ │ │
└──────────┼──────────┘
▼
┌──────────┐
│ MongoDB │ ← Namespaced collections per bot
└──────────┘
├── config.py # Environment vars, UI texts, logging
├── run.py # Entry point (starts everything)
├── requirements.txt # Dependencies
│
├── main_bot/
│ └── plugins/
│ ├── start.py # /start, menu, help, about, fsub gate
│ ├── create_bot.py # Bot creation flow
│ ├── my_bots.py # Bot list, dashboard, transfer data
│ ├── bot_settings.py# Force-sub, shortener, admins, stats
│ └── bans.py # /ban, /unban for main bot
│
├── worker_bot/
│ ├── engine.py # Dynamic multi-client manager
│ └── flink_logic.py # Formatted link generator
│
├── database/
│ ├── mongo.py # Motor client singleton
│ ├── main_db.py # Bot registry, user management
│ └── worker_db.py # Per-bot collections (isolated)
│
└── utils/
├── helpers.py # Encode/decode, validation, message utils
├── security.py # Token masking utilities
└── shortener.py # URL shortener API client
git clone https://github.com/abhinai2244/Muti-FileStoreBot.git
cd Muti-FileStoreBotpip install -r requirements.txtSet the following in your environment or edit config.py:
| Variable | Required | Description |
|---|---|---|
API_ID |
✅ | Telegram API ID from my.telegram.org |
API_HASH |
✅ | Telegram API Hash |
BOT_TOKEN |
✅ | Main controller bot token from @BotFather |
OWNER_ID |
✅ | Your Telegram numeric user ID |
MONGO_URI |
✅ | MongoDB connection string |
MAIN_LOG_CHANNEL |
✅ | Channel ID for system logs |
FSUB_CHANNEL |
❌ | Force-sub channel username (default: cantarellabots) |
MAX_BOTS_PER_USER |
❌ | Bot limit per user (default: 1) |
python run.py-
Add a
Procfileto your repo:worker: python run.py -
Set all environment variables in Heroku Settings → Config Vars.
-
Deploy as a Worker dyno (not Web).
RAM Note: A Heroku Basic dyno (512MB) can handle ~15-20 active bots simultaneously. The auto-hibernation system will sleep idle bots to free RAM automatically.
The backend provides the API for the permanent link feature. It is built to be deployed on Cloudflare Workers.
-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Update
wrangler.tomlwith your MongoDB credentials:MONGODB_APP_ID: Your MongoDB App ID.MONGODB_DATABASE: Your MongoDB database name.MONGODB_API_KEY: Your MongoDB Data API Key.BACKEND_API_SECRET: A secure secret key (make sure it matchesBACKEND_API_SECRETin your bot'sconfig.py).
-
Deploy to Cloudflare Workers:
npx wrangler deploy
-
Once deployed, copy your Cloudflare Worker URL and set it as
BACKEND_API_URLin your bot'sconfig.py.
When a bot is deleted, its data (users, admins, channels, banned list) is preserved in MongoDB.
To transfer data to a new bot:
- Delete the old bot from the dashboard
- Create a new bot
- Go to the new bot's Dashboard → tap 📦 Transfer
- Select the old bot → data is copied instantly
- Old bot data is permanently cleaned up after transfer
Tip: Use the same log channel on the new bot to keep old generated links working.
| Command | Description |
|---|---|
/check |
View all registered bots with owner info, tokens & status |
/broadcast |
Broadcast a message to all users of the platform |
/ban <user_id> |
Ban a user from the main controller bot |
/unban <user_id> |
Unban a user |
| Command | Description |
|---|---|
/start |
Welcome message / file retrieval via deep links |
/genlink |
Generate a shareable link for a single post |
/batch |
Generate a link for multiple consecutive posts |
/custom_batch |
Generate links for non-consecutive posts |
/flink |
Formatted batch link generator |
/broadcast |
Broadcast a message to the bot's users |
/ban <user_id> |
Ban a user from the worker bot |
/unban <user_id> |
Unban a user |
This project is open source. Feel free to fork, modify, and deploy.
Developed by @cantarellabots
