This repository contains code for an Image Processing Bot built using Python, Flask, and the Telegram API.
The bot allows users to send photos with captions indicating the desired image processing filter to apply, such as:
1- blur
2- contour
3- rotate
4- segment
5- salt and pepper
6- concatenation
Apply various image processing filters to photos sent by users.
Supported filters include blur, contour, rotate, segment, salt and pepper, and concatenation.
Error handling for graceful user experience.
Telegram webhook integration for real-time interaction.
Before running the application, ensure you have the following installed:
Python (>=3.6)
Flask
Matplotlib
Telebot
Loguru
1- Clone this repository to your local machine:
git clone https://github.com/ghazalkhateeb/PolybotServicePython.git
2- Navigate to the project directory:
cd directory path
3- Install dependencies using pip:
pip install -r requirements.txt
1- Set up a Telegram bot and obtain the token following this link: .
https://core.telegram.org/bots/features#botfather
2- Set the environment variables TELEGRAM_TOKEN with your Telegram bot token.
3- Sign up for the Ngrok service:
https://ngrok.com/
and go over the instructions :
https://dashboard.ngrok.com/get-started/setup
4- run this command:
ngrok http 8443
When the command ran, you will see "Forwarding line" with a link.
4- Set the environment variables TELEGRAM_APP_URL with your application URL in the forwarding line.
1- Run the Flask application by executing app.py:
python app.py
2- The application will start running.
3- you can greet the bot using those three words:
start, hello, hi.

3- Interact with the bot via your Telegram account by sending photos with captions indicating the desired image processing filter.
example 1:
example 2:
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue.