Skip to content

MN-BOTS/Test

 
 

Repository files navigation

Shobana Filter Bot

A powerful and versatile Telegram bot designed for filtering, automation, and much more!

✨ Features

  • ✅ Auto Filter
  • ✅ Manual Filter
  • ✅ IMDB Search and Info
  • ✅ Admin Commands
  • ✅ Broadcast Messages
  • ✅ File Indexing
  • ✅ Inline Search
  • ✅ Random Pics Generator
  • ✅ User and Chat Stats
  • ✅ Ban, Unban, Enable, Disable Commands
  • ✅ File Storage
  • ✅ Auto-Approval for Requests
  • ✅ Shortener Link Support (/short)
  • ✅ Feedback System
  • ✅ Font Styling (/font)
  • ✅ User Promotion/Demotion
  • ✅ Pin/Unpin Messages
  • ✅ Image-to-Link Conversion
  • ✅ Auto Delete: Automatically removes user messages after processing, so you don't need a separate auto-delete bot
  • ✅ Auto Restart
  • ✅ Keep Alive Function: Prevents the bot from sleeping or shutting down unexpectedly on platforms like Koyeb, eliminating the need for external uptime services like UptimeRobot.
  • ✅ /movies and /series Commands: Instantly fetch and display the most recently added movies or series with these commands.
  • ✅ Hyperlink Mode: When enabled, search results are sent as clickable hyperlinks instead of using callback buttons for easier access.
  • ✅ Multiple Request FSub support: You can add multiple channels. Easily update the required channels with the /fsub command, e.g., /fsub (channel1 id) (channel2 id) (channel3 id).
  • ✅ Delete Files by Query: Use the /deletefiles command to delete all files containing a specific word in their name. For example, /deletefiles predvd removes all files with 'predvd' in their filename.
  • ✅ Auto delete for files.
  • ✅ Channel file sending mode with multiple channel support.
  • ✅ SQL database (postgrasql) support (Optional).
  • ✅ 5 MongoDb support (optional).

🤖 Commands & Bot Features

Full command list

Core / Search

  • /start
  • /movies
  • /series
  • /imdb, /mnsearch
  • /search

Filter / Connection

  • /filter, /add
  • /filters, /viewfilters
  • /del
  • /delall
  • /connect
  • /disconnect
  • /connections
  • /settings

Utilities / Extras

  • /id
  • /info
  • /bug, /bugs, /feedback
  • /paste, /pasty, /tgpaste
  • /short
  • /tr
  • /font
  • /genpassword, /genpw
  • /tts
  • /carbon
  • /stickerid
  • /json, /js, /showjson
  • /img, /cup, /telegraph
  • /share, /share_text, /sharetext
  • /echo
  • /pin
  • /unpin
  • /unpin_all
  • /promote
  • /demote

Admin / Owner

  • /stats
  • /invite
  • /ban
  • /unban
  • /users
  • /chats
  • /channel
  • /broadcast
  • /grpbroadcast
  • /logs
  • /delete
  • /deleteall
  • /deletefiles
  • /fsub
  • /set_template
  • /setskip
  • /clear_join_users
  • /leave
  • /disable
  • /enable
  • /ping
  • /usage
  • /restart

Feature highlights shown in Help

  • Auto + manual filter responses
  • Channel file indexing and searchable DB
  • Inline result support and hyperlink result mode
  • IMDB cards with metadata and posters
  • Spell check suggestions for missing titles
  • Multiple force-sub channels and gated access
  • PM connection manager for group controls
  • File auto-delete and protected media delivery
  • Multi DB backend support (MongoDB / PostgreSQL)
  • Broadcast tools and moderation controls

🔧 Variables

Required

  • BOT_TOKEN: Obtain via @BotFather.
  • API_ID: Get this from Telegram Apps.
  • API_HASH: Also from Telegram Apps.
  • CHANNELS: Telegram channel/group usernames or IDs (space-separated).
  • ADMINS: Admin usernames or IDs (space-separated).
  • DATABASE_URI: Primary MongoDB URI (first priority if set).
  • DATABASE_NAME: Primary MongoDB database name.
  • DATABASE_URI2..DATABASE_URI5: Optional extra MongoDB URIs (up to 5 total) for sharded media indexing/search.
  • DATABASE_NAME2..DATABASE_NAME5: Optional database names for those extra MongoDB URIs (defaults to DATABASE_NAME).
  • POSTGRES_URI: PostgreSQL connection URI used when DATABASE_URI is not set.
  • LOG_CHANNEL: Telegram channel for activity logs.

Database priority order

  1. DATABASE_URI (MongoDB)
  2. POSTGRES_URI (PostgreSQL SQL backend)

Optional

  • PICS: Telegraph links for images in start message (space-separated).
  • FILE_STORE_CHANNEL: Channels for file storage (space-separated).
  • POSTGRES_STORAGE_LIMIT_BYTES: Optional PostgreSQL quota for accurate /stats free storage in SQL mode (supports formats like 1073741824, 1024MB, 1GB).
  • Refer to info.py for more details.

🚀 Deployment (Beginner Friendly Full Guide)

This guide supports MongoDB or PostgreSQL:

  1. MongoDB (DATABASE_URI) with optional media shards (DATABASE_URI2..DATABASE_URI5)
  2. PostgreSQL (POSTGRES_URI) when MongoDB is not set.

1) Minimum environment variables

BOT_TOKEN=123456:ABC...
API_ID=1234567
API_HASH=xxxxxxxxxxxxxxxxxxxxxxxxxx
ADMINS=123456789
CHANNELS=-1001234567890
LOG_CHANNEL=-1001234567890

Then choose one DB method below.


2) MongoDB connection (recommended for beginners)

  1. Create account: https://www.mongodb.com/cloud/atlas/register
  2. Create cluster.
  3. Database Access → create DB user.
  4. Network Access → allow your server IP.
  5. Connect → Drivers → copy URI.
  6. Set environment values:
DATABASE_URI=mongodb+srv://<username>:<password>@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority
DATABASE_NAME=Cluster0
COLLECTION_NAME=mn_files

Quick test:

from pymongo import MongoClient
uri = "mongodb+srv://<username>:<password>@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority"
client = MongoClient(uri, serverSelectionTimeoutMS=5000)
print(client.admin.command("ping"))

3) PostgreSQL connection (exact format)

You need:

  • host
  • port (5432 usually)
  • database name
  • username
  • password

URI format:

postgresql+psycopg2://USERNAME:PASSWORD@HOST:5432/DATABASE_NAME

Example env:

POSTGRES_URI=postgresql+psycopg2://bot_user:StrongPass@your-host:5432/shobana_bot

Create DB/user manually:

CREATE DATABASE shobana_bot;
CREATE USER bot_user WITH ENCRYPTED PASSWORD 'StrongPass';
GRANT ALL PRIVILEGES ON DATABASE shobana_bot TO bot_user;

Quick test:

from sqlalchemy import create_engine, text
engine = create_engine("postgresql+psycopg2://bot_user:StrongPass@your-host:5432/shobana_bot")
with engine.connect() as c:
    print(c.execute(text("SELECT 1")).scalar())

Important:

  • Leave DATABASE_URI empty if using PostgreSQL.
  • Set POSTGRES_STORAGE_LIMIT_BYTES to your provider quota (examples: 1GB, 1024MB, or raw bytes) if you want /stats free storage to show DB quota-based remaining space.
  • Do not set MySQL/SQLite/Turso variables (not used in this repo now).

4) Where to deploy

  • Koyeb: easiest for beginners
  • Render
  • Railway
  • VPS (advanced)

For all platforms:

  1. Fork repo.
  2. Add env variables.
  3. Deploy.
  4. Verify bot with /start.

5) Common errors

  1. DATABASE_URI set but Mongo auth fails → recheck DB username/password and network access.
  2. PostgreSQL connection refused → check host/port/firewall/SSL requirements.
  3. Invalid PostgreSQL URI → ensure it starts with postgresql+psycopg2://.
  4. Bot not responding in channels → make bot admin in channels listed in CHANNELS.

💬 Support

Telegram Group Telegram Channel


🙏 Credits
  • Dan for the Pyrogram Library
  • Mahesh for the Media Search Bot
  • EvamariaTG for the EvaMaria Bot
  • Trojanz for Unlimited Filter Bot
  • Goutham for ping feature
  • MN TG for editing and modifying this repository(Currently It's Me)
  • If your intrested to Collab with us Just fork this repo and create pull request ------ Click Here To Fork Repo

📜 Disclaimer

GNU AGPLv3

This project is licensed under the GNU AGPL 3.0. Selling this code for monetary gain is strictly prohibited.


About

Shobana filter bot is the best auto filter bot which have some unique and advanced features

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.9%
  • Other 0.1%