GitHunt
AN

AngelusGi/cocciabot

telegram bot

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

  1. Clone the repository:

    git clone https://github.com/yourusername/your-repo.git
    cd your-repo
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Create a .env file 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.py

Using Docker

  1. Build the Docker image:

    docker build -t telegram-bot --build-arg TOKEN=your-telegram-bot-token .
  2. Run the Docker container:

    docker run -d --name telegram-bot telegram-bot

Usage

  • Start a chat with your bot on Telegram.
  • Use the /start command to receive a welcome message.
  • Use the /help command to get help information.
  • Use the /caps <text> command to convert text to uppercase.

License

This project is licensed under the MIT License.

Languages

Python100.0%

Contributors

MIT License
Created December 22, 2024
Updated December 22, 2024
AngelusGi/cocciabot | GitHunt