Skip to content

ghazalkhateeb/PolybotServicePython

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Processing Telegram Bot

Introduction

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

Features

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.

Prerequisites

Before running the application, ensure you have the following installed:
Python (>=3.6)
Flask
Matplotlib
Telebot
Loguru

Installation

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

Configuration

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.

Usage

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. image

3- Interact with the bot via your Telegram account by sending photos with captions indicating the desired image processing filter.
example 1:
image
example 2:
image

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%