- 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.
Watch this video to create bot - https://youtu.be/dsuTn4qV2GA
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
BOT_TOKEN
: Create a bot using @BotFather, and get the Telegram API token.API_ID
: Get this value from telegram.orgAPI_HASH
: Get this value from telegram.orgCHANNELS
: Username or ID of channel or group. Separate multiple IDs by spaceADMINS
: Username or ID of Admin. Separate multiple Admins by spaceDATABASE_URI
: mongoDB URI. Get this value from mongoDB. For more help watch this videoDATABASE_NAME
: Name of the database in mongoDB. For more help watch this video
COLLECTION_NAME
: Name of the collections. Defaults to Telegram_files. If you going to use same database, then use different collection name for each botMAX_RESULTS
: Maximum limit for inline search resultsCACHE_TIME
: The maximum amount of time in seconds that the result of the inline query may be cached on the server
channel - Get basic infomation about channels
total - Show total of saved files
delete - Delete file from database
logger - Get log file
- Run one_time_indexer.py file to save old files in the database that are not indexed yet.
- You can use
|
to separate query and file type while searching for specific type of file. For example:Avengers | video
- If you don't want to create a channel or group, use your chat ID / username as the channel ID. When you send a file to a bot, it will be saved in the database.
Contributions are welcome.
Thanks to Pyrogram
Code released under The GNU General Public License.