razielaka / Media-Search-bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

  • Index channel/group files for inline search.
  • When you going to post file on telegram channel/group this bot will save that in database, So you can search that easily in inline mode.
  • Supports document, video and audio file formats with caption.

Installation

Easy Way

Deploy

Watch this video to create bot - https://youtu.be/dsuTn4qV2GA

Hard Way

python3 -m venv env
. ./env/bin/activate
pip install -r requirements.txt
# <Edit info.py with variables as given below>
python bot.py

Check sample_info.py before editing info.py file

Variables

Required Variables
  • BOT_TOKEN: Create a bot using @BotFather, and get the Telegram API token.
  • API_ID: Get this value from telegram.org
  • API_HASH: Get this value from telegram.org
  • CHANNELS: Username or id of channel or group. Separate multiple ids by space
  • ADMINS: Username or id of Admin. Separate multiple Admins by space
  • DATABASE_URI: mongoDB URI. Get this value from mongoDB. For more help watch this video
  • DATABASE_NAME: Name of the database in mongoDB. For more help watch this video
Optional Variables
  • COLLECTION_NAME: Name of the collections. Defaults to Telegram_files. If you going to use same database, then use different collection name for each bot
  • MAX_RESULTS: Maximum limit for inline search results
  • CACHE_TIME: The maximum amount of time in seconds that the result of the inline query may be cached on the server

Admin commands

channel - Get basic infomation about channels
total - Show total of saved files
delete - Delete file from database
logger - Get log file

Contributions

Contributions are welcome.

Thanks to Pyrogram

License

Code released under The GNU General Public License.

About

License:GNU General Public License v2.0


Languages

Language:Python 100.0%