/ReVot

Reverse Image Search Telegram Bot Using MS Azure/Local (server maybe off)

Primary LanguagePythonMIT LicenseMIT

ReVotRobot

Reverse Image Search Telegram Bot Using MS Azure/Local (server maybe off)

🌟 Stars 🍴 Forks πŸ› Issues πŸ”” Open PRs πŸ”• Close PRs πŸ›  Languages 🌐 Contributors
Stars Forks Issues Open Pull Requests Close Pull Requests GitHub language count GitHub contributors

Contact

☁️ Cloud 🐧 OS πŸ’» Terminal πŸ“¦ PyPI ❀️ Open Source

✨Table of Contents:


How To Use Me: Alien Monster

Send me images, gifs or stickers(non-animated), I will send you direct reverse image search links of IQDB, Google, TinEye, Yandex and Bing. For anime images IQDB and TinEye, for other images, I recommend using Google, Bing and Yandex.

Features: Roller Coaster

  • Give you image reverse search links
  • Supports normal images like JPG, PNG, WEBP
  • Supports stickers
  • Supports GIFs (can take some time till the GIFs are ready)

Commands:🧩

  • /help, /start: show a help message with information about the bot and its usage.
  • /best_match URL: Search for the best match on TinEye (and IQDB when nothing is found on TinEye). The URL is a link to an image

Local installation: Technologist Light Skin Tone

With this info, we now install our virtual environment with (check pre-installations file):

chmod +x pre-installations.sh
./pre-installations.sh
pip install pipenv  # Install pipenv
pipenv --version
git clone https://github.com/c0sm0void/ReVot.git
cd /ReVot
pipenv shell
pipenv install      # Install all requirements

You have to get an API Token from Telegram. You can easily get one via the @BotFather.

Now that you have your API Token, create a settings.py file and add one of the configurations below based on your preferred uploading method.

Option 1: SSH Uploader

If you want to upload files using SSH, use the following configuration in your settings.py:

TELEGRAM_API_TOKEN = 'Tel Bot Token By @BotFather'

UPLOADER = {
    'uploader': 'reverse_image_search_bot.uploaders.ssh.SSHUploader',
    'url': 'Host Domain Name',
    'configuration': {
        'host': 'Host IP (PUBLIC)',
        'user': 'Yourname',
        'password': 'Password',
        'upload_dir': '/path/to/ReVot/',
        'key_filename': '/path/to/.ssh/rsakey.pub (Public key)',
    }
}

Option 2: File System Uploader

If you prefer to upload files from your local file system, use the following configuration in your settings.py:

TELEGRAM_API_TOKEN = 'Tel Bot Token By @BotFather'

UPLOADER = {
    'uploader': 'reverse_image_search_bot.uploaders.file_system.FileSystemUploader',
    'url': 'Host Domain Name',
    'configuration': {
       'path': '/path/to/ReVot/',
    }
}

Finally, you can use this to start your bot.

python run_bot.py

Errors and Fixes:❌

  • Use Python v3.12 as default
  • ssh-keyscan -H <IP address/Hostname> >> ~/.shh/known_hosts
  • sudo -H pip install -U pipenv

Techstack

Programming Language:

  • Python 3.12+

Libraries:

  • pipenv: For virtual environment and dependency management
  • python-telegram-bot: For interacting with Telegram APIs
  • Reverse Image Search Engines:
    • Google
    • Bing
    • Yandex
    • TinEye
    • IQDB

Platform:

  • MS Azure for hosting
  • Ubuntu virtual machine for hosting

Repository Structure: Crystal Ball

ReVot/
β”‚
β”œβ”€β”€ .github/                    # GitHub-specific files
β”‚   └── ISSUE_TEMPLATE/
β”‚       β”œβ”€β”€ bug_report.md       # Template for reporting bugs
β”‚       β”œβ”€β”€ custom.md           # Custom issue template
β”‚       └── feature_request.md  # Template for requesting features
β”‚   β”‚
β”‚   └── workflows/                     # Directory for GitHub Actions workflows
β”‚		β”œβ”€β”€ greetings.yml      # Workflow for greeting new contributors
β”‚		└── labeler.yml        # Workflow for auto-labeling pull requests and issues
β”‚   
β”œβ”€β”€ deploy/                        # Deployment scripts and configurations
β”‚   └── after_push                 # Post-deployment scripts
β”‚
β”œβ”€β”€ reverse_image_search_bot/      # Main bot directory
β”‚   β”œβ”€β”€ images/                    # Sample image for demonstration
β”‚   β”‚   └── example_usage.png      # Example bot usage
β”‚   β”‚
β”‚   β”œβ”€β”€ uploaders/             # Uploader modules
β”‚   β”‚   β”œβ”€β”€ __init__.py        # Initialize uploaders package
β”‚   β”‚   β”œβ”€β”€ base_uploader.py   # Base class for uploaders
β”‚   β”‚   β”œβ”€β”€ file_system.py     # File system operations
β”‚   β”‚   └── ssh.py             # SSH related functions
β”‚   β”‚
β”‚   β”œβ”€β”€ __init__.py            # Initialize bot package
β”‚   β”œβ”€β”€ bot.py                 # Main bot logic
β”‚   β”œβ”€β”€ commands.py            # Command handling for the bot
β”‚   β”œβ”€β”€ image_search.py        # Functions for reverse image search
β”‚   β”œβ”€β”€ settings.example.py    # Example settings file for API tokens
β”‚   β”œβ”€β”€ settings.example1.py   # Another example settings file
β”‚   β”œβ”€β”€ settings.py            # Settings file
β”‚   └── utils.py               # Utility functions and helpers
β”‚
β”œβ”€β”€ .gitignore                 # Files and directories to be ignored by Git
β”œβ”€β”€ CODE_OF_CONDUCT.md         # Community guidelines and rules
β”œβ”€β”€ CONTRIBUTING.md            # Contribution guidelines
β”œβ”€β”€ LICENSE                    # License information
β”œβ”€β”€ Pipfile                    # Pipenv dependencies
β”œβ”€β”€ Pipfile.lock               # Locked dependency versions
β”œβ”€β”€ pre-installations.sh       # Pre-installation
β”œβ”€β”€ README.md                  # Main project documentation
└── run_bot.py                 # Script to run the bot



License:πŸ“œ

This project is licensed under the MIT License. You are free to use, modify, and distribute this software as long as the original license and copyright notice are retained.

This project is now OFFICIALLY accepted for

GSSoC 2024 Extd Hacktoberfest 2024

How to Contribute:

1. Fork the repository to your GitHub account.

2. Clone the forked repository to your local machine.

git clone https://github.com/c0sm0void/ReVot.git

3. Create a new branch for your changes.

git checkout -b feature/your-feature

4. Make your changes, whether they're bug fixes, new features, or improvements.

5. add the change in your branch

git add .

6. Commit your changes with descriptive commit messages.

git commit -m "Add your descriptive commit message here"
git push origin feature/your-feature

7. Open a Pull Request (PR) against the main repository.

Process:

flowchart LR
    Fork[Fork the project]-->branch[Create a New Branch]
    branch-->Edit[Edit file]
    Edit-->commit[Commit the changes]
    commit -->|Finally|creatpr((Create a Pull Request))
Loading

Beating Heart Our Contributors

  • We extend our heartfelt gratitude for your invaluable contribution to our project! Your efforts play a pivotal role in elevating ReVot to greater heights.
  • Make sure you show some love by giving Star to our repository.
Pushes and Commits of c0sm0void/ReVot Top Contributors of c0sm0void/ReVot - Last 28 days

Support

Don't forget to leave a star for this project!

Go to Top