# Create virtual environment
python3 -m venv env
# Activate virtual environment
env\Scripts\activate.bat # For Windows
source env/bin/activate # For Linux or MacOS
# Install Packages
pip3 install -r requirements.txt
# Edit info.py with variables as given below then run bot
python3 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 videoOMDB_API_KEY
: OMBD_API_KEY to generate imdb poster for filter results.Get it from omdbapi.comCUSTOM_FILE_CAPTION
: A custom caption for your files. You can format it with file_name, file_size, file_caption.(supports html formating)
Example: <b>Join [XTZ Bots](https://t.me/subin_works) for more useful bots</b>\n\n<code>{file_name}</code>\nSize{file_size}\n{file_caption}.
AUTH_GROUPS
: ID of groups which bot should work as autofilter, bot can only work in thease groups. If not given , bot can be used in any group.COLLECTION_NAME
: Name of the collections. Defaults to Telegram_files. If you going to use same database, then use different collection name for each botCACHE_TIME
: The maximum amount of time in seconds that the result of the inline query may be cached on the serverUSE_CAPTION_FILTER
: Whether bot should use captions to improve search results. (True/False)AUTH_USERS
: Username or ID of users to give access of inline search. Separate multiple users by space. Leave it empty if you don't want to restrict bot usage.AUTH_CHANNEL
: ID of channel. Without subscribing this channel users cannot use bot.START_MSG
: Welcome message for start command.channel - Get basic infomation about channels
total - Show total of saved files
delete - Delete file from database
index - Index all files from channel.
logger - Get log file
|
to separate query and file type while searching for specific type of file. For example: Avengers | video
Contact Me On Telegram
Code released under The GNU General Public License.