A powerful Telegram media search bot β search movies and files directly in PM or any group, with paginated results, auto-delete, broadcast, user tracking, and deep-link file delivery.
| Feature | Description |
|---|---|
| π¬ PM Search | Type any name β paginated file buttons β tap to receive instantly |
| π₯ Group Search | Results shown in group β tap β file delivered to your PM via deep-link |
| π Deep-Link Delivery | Group buttons use t.me/bot?start=<file_id> β works even if user never started bot |
| ββΆ Prev / Next Pages | Pagination with live page counter β only the searcher can press PREV/NEXT |
| π Auto-Delete | Files auto-delete after configurable time to avoid copyright issues |
| π Save Reminder | Users instructed to forward to Saved Messages before deletion |
| π€ User Tracking | Every /start user is saved to DB; new users trigger a log channel notification |
| π’ Broadcast | Send any message (text, photo, video, etc.) to all registered users |
| π‘ Auto Index | New files posted in watched channels saved to DB instantly |
| π Admin Commands | Full suite: /index, /setskip, /total, /users, /broadcast, /delete, /channel, /logs |
| π Inline Mode | Search via @bot query in any chat |
| π Force Subscribe | Optionally require users to join a channel before access |
| π Always Alive | Built-in aiohttp web server β compatible with Render & Koyeb (no sleep) |
User: Kumki
Bot:
π Results for: Kumki
π Found: 9 file(s)
π Tap a file β you'll be taken to my PM where it will be sent!
[1.59 GB]- π¬ -Kumki 2 (2025) Tamil HQ HDRip 1080p HEVC xβ¦
[1.38 GB]- π¬ -Kumki 2 (2025) Tamil HQ HDRip 720p x264 (Dβ¦
[904.43 MB]- π¬ -Kumki 2 (2025) Tamil HQ HDRip 720p HEVC β¦
ββββββββββββββββββββββββββββββββββββββββββ
[π 1/2] [NEXT βΆ]
π¬ Kumki 2 (2025) Tamil HQ HDRip 1080p HEVC x265.mkv
π¦ Size: 1.59 GB
π Type: Video
β οΈ This file will be auto-deleted in 5 minute(s) to avoid copyright issues.
π Forward it to your Saved Messages to keep it forever!
[πΎ Save to Saved Messages]
π€ New User Started Bot!
π ID: 123456789
π Name: John Doe
π Username: @johndoe
π
Joined: 12 Mar 2026 β’ 10:45 UTC
π₯ Total Users: 142
π’ Broadcastingβ¦
[ββββββββββ] 40%
Done: 400/1000
β
Sent: 385
π« Blocked: 12 β auto-removed from DB
β Failed: 3
[β Cancel]
- Click the button above
- Fill in the required environment variables
- Deploy β uses
heroku.yml(container stack) βweb: python main.py
Note: Switch your Heroku app to the container stack first:
heroku stack:set container -a <your-app> git push heroku main
- Connect your GitHub repo
- Set Start Command:
python main.py - Set Health Check URL:
/health - Add all environment variables
- Deploy β the built-in web server keeps the container alive permanently
git clone https://github.com/GouthamSER/auto-filter-bot-v1
cd auto-filter-bot-v1
pip install -r requirements.txt
cp sample.env .env
# Edit .env with your values
python main.py| Variable | Description |
|---|---|
API_ID |
Get from my.telegram.org |
API_HASH |
Get from my.telegram.org |
BOT_TOKEN |
Get from @BotFather |
DATABASE_URI |
MongoDB connection string (e.g. mongodb+srv://...) |
ADMINS |
Space-separated Telegram user IDs β e.g. 123456 789012 |
CHANNELS |
Space-separated channel IDs the bot watches β e.g. -100123 -100456 |
LOG_CHANNEL |
Channel ID for bot logs + new user notifications |
| Variable | Default | Description |
|---|---|---|
DATABASE_NAME |
MediaSearchDB |
MongoDB database name |
COLLECTION_NAME |
Telegram_files |
MongoDB collection name |
SESSION |
MediaSearchBot |
Pyrogram session name |
MAX_RESULTS |
10 |
Files shown per page |
AUTO_DELETE_TIME |
300 |
Seconds before file is deleted (300 = 5 min) |
CACHE_TIME |
300 |
Inline query cache duration in seconds |
USE_CAPTION_FILTER |
false |
Also search inside file captions |
AUTH_CHANNEL |
β | Force users to join this channel ID before using bot |
URL |
β | Your app's public URL for keep-alive pings |
PORT |
8080 |
Web server port (auto-set by Render/Koyeb/Heroku) |
| Variable | Description |
|---|---|
START_MSG |
Custom welcome message. Supports {mention}, {username}, {first_name} |
FORCE_SUB_MSG |
Message shown when user hasn't joined AUTH_CHANNEL |
| Command | Description |
|---|---|
/start |
Welcome message + inline search buttons |
π‘
/helpand/statusare available as inline buttons on the start message β not slash commands.
| Command | Description |
|---|---|
/index |
Bulk-index a channel range (two-step wizard β no userbot needed) |
/cancelindex |
Abort the index wizard mid-setup |
/setskip <N> |
Set message-ID offset before indexing (resume from a specific point) |
/total |
Total files saved in database |
/users |
Total registered users count |
/broadcast |
Send a message to all users (reply to any message, or inline text) |
/cancelbroadcast |
Stop a running broadcast mid-way |
/channel |
List all watched/indexed channels |
/delete |
Reply to any media message β removes it from DB |
/logs |
Download the bot log file |
Open @BotFather β your bot β Edit Bot β Edit Commands β paste:
start - Start the bot / get welcome message
index - Index a channel range (wizard)
cancelindex - Abort a running index wizard
setskip - Set message-ID offset for indexing
total - Total files in the database
users - Total registered users
broadcast - Broadcast a message to all users
cancelbroadcast - Stop an in-progress broadcast
channel - List watched/indexed channels
delete - Remove a file from the database (reply to it)
logs - Get the bot log file
Or use the included script to set scoped commands automatically
(regular users only see /start, admins see the full list):
export BOT_TOKEN=your_token
export ADMINS="123456789 987654321"
python set_commands.pyOption 1 β Copy any message (photo, video, sticker, textβ¦):
Reply to any message with /broadcast
Option 2 β Inline text only:
/broadcast π New movies added! Go search now!
Bot shows a preview with recipient count and Confirm / Cancel buttons before sending. Live progress updates during send. Blocked/deactivated users are automatically removed from the database.
- Basic: type any movie or file name in PM or any group
- Filter by type:
movie name | videoorsong name | audioordoc name | document - Inline anywhere:
@YourBot movie namein any chat - Pagination: tap β PREV / NEXT βΆ to browse all results β only the user who searched can press these
- Group: results appear in the group; tapping a file delivers it to your PM
auto-filter-bot-v1/
βββ main.py β Bot entry point + aiohttp web server + keep-alive
βββ config.py β All configuration via environment variables
βββ set_commands.py β One-shot script to set BotFather command scopes
βββ requirements.txt
βββ Dockerfile β Docker image (used by Heroku container stack)
βββ heroku.yml β Heroku container stack config
βββ sample.env β Example environment variables
β
βββ database/
β βββ __init__.py
β βββ db.py β MongoDB motor (Media + Users collections)
β
βββ plugins/
βββ __init__.py
βββ start.py β /start + deep-link file delivery + force-subscribe + help/status buttons
βββ search.py β PM & group search, pagination (owner-only), auto-delete
βββ inline.py β Inline mode search
βββ channel.py β Auto-index new files from watched channels
βββ users.py β User tracking + new user log channel notification
βββ broadcast.py β /broadcast with live progress + cancel + auto-cleanup
βββ admin.py β /index wizard + all other admin commands
| Collection | Purpose |
|---|---|
Telegram_files |
All indexed media files (searchable) |
users |
All registered users β used for broadcast & analytics |
- Pyrogram v2 β Telegram MTProto client
- Motor β Async MongoDB driver
- aiohttp β Async web server (keep-alive for Render/Koyeb)
- MongoDB Atlas β Cloud database (free tier works)
| Role | Person |
|---|---|
| Maintainer & Rewritten By | GouthamSER |
| Original Concept | Media-Search-bot |
This project is licensed under the MIT License.
Made with β€οΈ by GouthamSER