This is a Telegram bot script that allows users to send files via email. Users can interact with the bot to provide their email address and upload files, which will then be sent as email attachments.
- Provides a simple interface for users to enter their email address and send files.
- Validates email addresses to ensure proper formatting.
- Downloads files from Telegram and sends them as attachments via email.
To use this bot, you need to follow these steps:
- Clone this repository to your local machine.
- Install the required dependencies by running
pip install -r requirements.txt
. - Set up your Telegram bot token and email credentials in the
main.py
script. - Run the bot by executing
python main.py
. - Start interacting with the bot in your Telegram chat.
- Start the bot by sending the
/start
command. - Follow the prompts to enter your email address and upload a file.
- The bot will send the uploaded file to the provided email address as an attachment.
You can also run this bot using Docker. Follow these steps:
- Build the Docker image using the provided Dockerfile:
docker build -t telegram-email-bot .
- Run the Docker container:
docker run -d --name telegram-bot telegram-email-bot
The tests.py
script contains several test functions to ensure the proper functionality of the bot. These tests cover various scenarios, including:
- Sending an email with a valid file.
- Handling incorrect file names.
- Handling malformed email addresses.
tests.py
: Contains test functions to verify the functionality of the bot.test_tool.py
: Provides utility functions and classes for testing the bot using Selenium WebDriver.
- Python 3.x
- Selenium WebDriver
- Chrome WebDriver
- Telegram account