Skip to content

GouthamSER/auto-filter-bot-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 auto-filter-bot-v1

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.


✨ Features

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 AutoFilterBot-style pagination with live page counter
πŸ—‘ 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)

πŸ–Ό Preview

Group Search

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 β–Ά]

File Caption in PM

🎬 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 Notification in Log Channel

πŸ‘€ New User Started Bot!

πŸ†” ID: 123456789
πŸ“› Name: John Doe
πŸ”— Username: @johndoe
πŸ“… Joined: 12 Mar 2026 β€’ 10:45 UTC

πŸ‘₯ Total Users: 142

Broadcast Progress

πŸ“’ Broadcasting…

[β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘] 40%
Done: 400/1000

βœ… Sent: 385
🚫 Blocked: 12  ← auto-removed from DB
❌ Failed: 3

[β›” Cancel]

πŸš€ Deploy

Heroku

Deploy

  1. Click the button above
  2. Fill in the required environment variables
  3. Deploy β€” uses Procfile β†’ worker: python main.py

Render / Koyeb

  1. Connect your GitHub repo
  2. Set Start Command: python main.py
  3. Set Health Check URL: /health
  4. Add all environment variables
  5. Deploy β€” the built-in web server keeps the container alive permanently

Manual / VPS

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

βš™οΈ Environment Variables

Required

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

Optional

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)
USE_CAPTION_FILTER false Also search inside file captions
AUTH_CHANNEL β€” Force users to join this channel ID before using bot
PORT 8080 Web server port (auto-set by Render/Koyeb)

Custom Messages (Optional)

Variable Description
START_MSG Custom welcome message. Supports {mention}, {username}, {first_name}
FORCE_SUB_MSG Message shown when user hasn't joined AUTH_CHANNEL

πŸ€– Bot Commands

Everyone

Command Description
/start Welcome message + search buttons

Admins Only

Command Description
/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 channels
/index <channel_id> Bulk-index a channel (bot-only, no userbot needed)
/setskip <N> Set message skip offset for /index (resume indexing)
/delete Reply to any media β†’ removes it from DB
/logs Download the log file

πŸ“’ Broadcast Usage

Option 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.


πŸ” Search Tips

  • Basic: type any movie or file name in PM or any group
  • Filter by type: movie name | video or song name | audio
  • Inline anywhere: @YourBot movie name in any chat
  • Pagination: tap β—€ PREV / NEXT β–Ά to browse all results
  • Group: results appear in the group; tapping a file delivers it to your PM

πŸ“ Project Structure

auto-filter-bot-v1/
β”œβ”€β”€ main.py                 ← Bot entry point + aiohttp web server
β”œβ”€β”€ config.py               ← All configuration via environment variables
β”œβ”€β”€ index.py                ← Standalone channel bulk-indexer (CLI)
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ Procfile                ← Heroku: worker: python main.py
β”œβ”€β”€ 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
    β”œβ”€β”€ search.py           ← PM & group search, pagination, 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            ← Admin commands + bot-only channel indexer

πŸ—„ Database Collections

Collection Purpose
Telegram_files All indexed media files (searchable)
users All registered users β€” used for broadcast & analytics

πŸ›  Tech Stack

  • 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)

πŸ‘¨β€πŸ’» Credits

Role Person
Maintainer & Rewritten By GouthamSER
Original Concept Media-Search-bot

πŸ“„ License

This project is licensed under the MIT License.


Made with ❀️ by GouthamSER

About

Auto Filter Bot Telegram Easy to deploy and light weight no other modules added basics only ........

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages