Skip to content

neocim/steal_stickers_bot

Repository files navigation

steal_stickers_bot

Preparing

  1. Install Docker and Docker Compose.
  2. Create your Telegram application following instructions.
  3. Get the bot token from @BotFather.
  4. Clone our repository:
git clone https://github.com/Nnenty/steal_stickers_bot
  1. Cd into catalog:
cd steal_stickers_bot
  1. Copy config.toml.example, remove .example from name of file and fill it required information.
  2. Copy .env.example, remove .example from name of file and fill it the same required information as in your file config.toml.

Run bot

  1. Authorize client

To authorize client run command below:

just auth

Download justfile

or if you want run it manually:

docker build -t steal_stickers_bot . && \
docker run -it --rm \
        --mount type=bind,source=./configs,target=/app/configs \
        --name steal_stickers_bot steal_stickers_bot \
        auth

After you have launched Docker, a code should be sent to your Telegram account. Enter this code into your terminal.

  1. Run bot

To run bot use command below:

just compose-run

Download justfile

or if you want run it manually:

docker compose up
  1. Migrate database

After running bot will start working, but database will be without migrations. To solve it, run command below with your database information (that you put into .env and config.toml files):

sqlx migrate run --source ./src/infrastructure/database/migrations --database-url="postgres://{username}:{password}@{host}:{port}/{db}"

If you encounter errors that are directly related to my code (docker errors, bot errors, etc.), please open an Issue. Thanks :)

License

Licensed under: