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.
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.
// Directory tree
├── .gitignore
├── .python-version
├── Dockerfile
├── LICENSE
├── hello.jpg
├── main.py
├── README.md
├── pyproject.toml
└── uv.lock
src/main.py: Entry point of the application, starts the bot..env.example: Example environment variables file.pyproject.toml: Project definition and its dependencies.
-
Install
uv:curl -LsSf https://astral.sh/uv/install.sh | shOr for Windows:
irm https://astral.sh/uv/install.ps1 | iex
-
Clone the repository and navigate to the folder:
git clone https://github.com/Lemmy-VTube/username-changer-bot.git cd username-changer-bot -
Configure environment variables: Copy the example
.envfile and fill it with your data:cp src/.env.example src/.env
Open
src/.envand enter values forTOKEN_BOT. -
Install dependencies and run:
uv run start
-
Clone the repository and navigate to the folder:
git clone https://github.com/Lemmy-VTube/username-changer-bot.git cd username-changer-bot -
Configure environment variables: Copy the example
.envfile and fill it with your data:cp src/.env.example src/.env
Open
src/.envand enter values forTOKEN_BOT. -
Create and activate a virtual environment:
- Windows:
python -m venv .venv .venv/Scripts/activate
- macOS/Linux:
python3 -m venv .venv . .venv/bin/activate
- Windows:
-
Install dependencies:
pip install aiogram pydantic-settings
-
Run the bot:
python src/run.py
-
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.
- Arch Linux:
-
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-botto 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 nameusername-changer-botto the running container.--env-file src/.env: Instructs Docker to use environment variables fromsrc/.envinside the container.username-changer-bot-image: The name of the Docker image to run.