Skip to content

Lemmy-VTube/username-changer-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

username-changer-bot

username-changer-bot — This is a Telegram bot that notifies users that a new version of the bot is available under a different username, and the current version is no longer supported.

🛠 Tools and Libraries

The project uses the following main tools and libraries:

  • aiogram: An asynchronous library for developing Telegram bots in Python.
  • pydantic-settings: Settings management using Pydantic.
  • uv: An extremely fast package manager and bundler for Python.

📁 Project Structure

// Directory tree
├── .gitignore
├── .python-version
├── Dockerfile
├── LICENSE
├── hello.jpg
├── main.py
├── README.md
├── pyproject.toml
└── uv.lock

📄 Description of Important Files

  • src/main.py: Entry point of the application, starts the bot.
  • .env.example: Example environment variables file.
  • pyproject.toml: Project definition and its dependencies.

🚀 Setup and Running

Running without Docker

Using uv (recommended)

  1. Install uv:

    curl -LsSf https://astral.sh/uv/install.sh | sh

    Or for Windows:

    irm https://astral.sh/uv/install.ps1 | iex
  2. Clone the repository and navigate to the folder:

    git clone https://github.com/Lemmy-VTube/username-changer-bot.git
    cd username-changer-bot
  3. Configure environment variables: Copy the example .env file and fill it with your data:

    cp src/.env.example src/.env

    Open src/.env and enter values for TOKEN_BOT.

  4. Install dependencies and run:

    uv run start

Without uv

  1. Clone the repository and navigate to the folder:

    git clone https://github.com/Lemmy-VTube/username-changer-bot.git
    cd username-changer-bot
  2. Configure environment variables: Copy the example .env file and fill it with your data:

    cp src/.env.example src/.env

    Open src/.env and enter values for TOKEN_BOT.

  3. Create and activate a virtual environment:

    • Windows:
      python -m venv .venv
      .venv/Scripts/activate
    • macOS/Linux:
      python3 -m venv .venv
      . .venv/bin/activate
  4. Install dependencies:

    pip install aiogram pydantic-settings
  5. Run the bot:

    python src/run.py

Running with Docker

  1. Install Docker:

    • Arch Linux:
      sudo pacman -S docker
      sudo systemctl start docker
      sudo systemctl enable docker
      sudo usermod -aG docker $USER # Add user to docker group
      newgrp docker # Apply group changes
    • Debian/Ubuntu:
      sudo apt update
      sudo apt install docker.io
      sudo systemctl start docker
      sudo systemctl enable docker
      sudo usermod -aG docker $USER
      newgrp docker
    • Fedora:
      sudo dnf install docker
      sudo systemctl start docker
      sudo systemctl enable docker
      sudo usermod -aG docker $USER
      newgrp docker
    • Windows/macOS: Install Docker Desktop from the official Docker website.
  2. Build and run the Docker image:

    docker build -t username-changer-bot .
    • docker build: Command to build a Docker image.
    • -t username-changer-bot: Assigns the tag (name) username-changer-bot to the created image.
    • .: Indicates that the Dockerfile is in the current directory.
    docker run -d --name username-changer-bot --env-file src/.env username-changer-bot-image
    • docker run: Command to run a Docker container.
    • -d: Runs the container in detached mode.
    • --name username-changer-bot: Assigns the name username-changer-bot to the running container.
    • --env-file src/.env: Instructs Docker to use environment variables from src/.env inside the container.
    • username-changer-bot-image: The name of the Docker image to run.

About

This is a Telegram bot that notifies users that a new version of the bot is available under a different username, and the current version is no longer supported.

Topics

Resources

License

Stars

Watchers

Forks

Contributors