Telegram Bot
This is a simple Telegram bot built using the python-telegram-bot library. The bot can respond to commands such as /start, /help, and /caps.
Features
/start: Sends a welcome message./help: Provides help information./caps <text>: Converts the provided text to uppercase.
Setup
Prerequisites
- Python 3.11
- Docker (optional, for containerized deployment)
Installation
-
Clone the repository:
git clone https://github.com/yourusername/your-repo.git cd your-repo -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory and add your Telegram bot token and bot name:TG_BOT_TOKEN=your-telegram-bot-token TG_BOT_NAME=your-bot-name
Running the Bot
To run the bot, execute the following command:
python src/main.pyUsing Docker
-
Build the Docker image:
docker build -t telegram-bot --build-arg TOKEN=your-telegram-bot-token . -
Run the Docker container:
docker run -d --name telegram-bot telegram-bot
Usage
- Start a chat with your bot on Telegram.
- Use the
/startcommand to receive a welcome message. - Use the
/helpcommand to get help information. - Use the
/caps <text>command to convert text to uppercase.
License
This project is licensed under the MIT License.