Code Monkey home page Code Monkey logo

mediafinder's Introduction

Telegram Media Finder

A telegram bot to find files saved in its database.

Re-written version of Media Search bot

Features

  • Precise search option for more accurate results.
  • Auto index files from given database channel/group.
  • User settings for customization.
  • Admin settings within the bot.
  • Show search results as Button or List or List-Hyperlink.
  • Manual index of files from channels.
  • Supports document, video and audio file formats with file name caption support.
  • Add manual text filters.
  • Add username in file caption.
  • Ban/Unban users.
  • Broadcast to users.
  • Auto delete files after a certain time.
  • Force Subscription option.
  • Option for Custom Caption
  • Get logs / Restart from within the bot.

Environment Variables

Required Variables

  • BOT_TOKEN: Create a bot using @BotFather, and get the Telegram API token.
  • APP_ID: Get this value from telegram.org.
  • API_HASH: Get this value from telegram.org.
  • DB_CHANNELS: ID of database channel or group. Separate multiple IDs by space
  • OWNER_ID: User ID of owner.
  • ADMINS: User ID of Admins. Separate multiple Admins by space.
  • DB_URL: Link to connect postgresql database (setup details given below).

Database Setup

# Install postgresql:
sudo apt-get update && sudo apt-get install postgresql

# Change to the postgres user:
sudo su - postgres

# Create a new database user (change YOUR_USER appropriately):
createuser -P -s -e YOUR_USER
# This will be followed by you needing to input your password.

# create a new database table:
createdb -O YOUR_USER YOUR_DB_NAME
#Change YOUR_USER and YOUR_DB_NAME appropriately.

# finally:
psql -h YOUR_HOST -p YOUR_PORT -d YOUR_DB_NAME -U YOUR_USER

#This will allow you to connect to your database via your terminal.
By default, YOUR_HOST should be `localhost` & YOUR_PORT should be `5432`.

You should now be able to build your database URI. This will be:
sqldbtype://username:password@hostname:port/db_name

Replace your sqldbtype, username, password, hostname (localhost?), port (5432?), and db name in .env file.

Deployment

Run Locally / On VPS

# Clone this repo
git clone https://github.com/EL-Coders/mediafinder

# cd folder
cd mediafinder

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
venv\Scripts\activate # For Windows
source venv/bin/activate # For Linux or MacOS

# Install Packages
pip3 install -r requirements.txt

# Copy .env.sample file & add variables
cp .env.sample .env

# Run bot
python3 -m mfinder

If you want to modify start & help messages, copy sample_const.py to const.py and do the changes.

cp sample_const.py const.py

Support

Feedback or Support

Join our updates channel to get latest updates about our bots EL Updates

If you have any feedback or to report any issues, please reach out to us at EL Support

License

GPLv3 License

Contributing

Contributions are always welcome, but please test your code before pushing!

Also, kindly adhere to this project's code of conduct.

mediafinder's People

Contributors

jithumon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.