Skip to content

Telegram bot for removing the background from an image

License

Notifications You must be signed in to change notification settings

zaitsev-dev/benzin-io-bot

Repository files navigation

Benzin IO bot

Benzin-io is a small, asynchronous application that removes the background of the image. It uses a third-party API to process the photos and the Telegram Bot API to implement the user interface.

It also uses aiogram to implement fast and async Telegram bots, aiohttp to send async requests, and loguru for logging.

Installation

Firstly, you should create your Telegram bot and get its token (read more). Also, you have to create a Benzin.io account and take their API key too (read more). Finally, if you're done, you can start an installation.

Clone the repository and go into it:

git clone https://github.com/Leetovskiy/benzin-io-bot.git
cd benzin-io-bot

In this step, you have two options: use pipenv or pip. If you choose pip you should manually create a virtual environment to avoid conflicts with the system environment. pipenv does it by itself, so you do not need to do anything.

# For pip users
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# For pipenv users
pipenv install

Next, you should pass your Telegram bot token and Benzin.io API key to environment variables. You may also want to create an.env file and store this information in it if you use pipenv.

# For pip users
export BOT_TOKEN="<your_token>"
export BENZIN_TOKEN="<your_key>"
# .env file (for pipenv users)
BOT_TOKEN=<your_token>
BENZIN_TOKEN=<your_key>

All right, that's it. Try running main.py and sending the /start command to chat.

python main.py

License

The Apache 2.0 license applies to the project's sources. For further details, refer to the LICENSE.txt file.

Contribution

Feel free to make a pull request and contribute if you accept the Apache 2.0 license. I'm also open to discussing any suggestions you may have regarding this project.


About

Telegram bot for removing the background from an image

Topics

Resources

License

Stars

Watchers

Forks

Languages