sticker-bot

Sticker packs telegram bot

GitHub GitHub last commit GitHub code size in bytes Python Version GitHub watchers

Try it right now!

@paces_bot

Installation

Bot simply can be installed by running code on machine using required variables in .env file

If you’re using webhooks, you should set up reverse proxy. You can start with aiogram documentation or read tutorial on webhooks (the tutorial is in ukrainian🇺🇦). Both use nginx and tutorial uses certbot.

Installation guide step by step

  1. Requirements
  1. Clone project
git clone https://github.com/RoLO0u/sticker-bot.git
  1. Install python requirements
pip install -r requirements.txt

:warning: when having problems installing psycopg2: try running

on debian:

sudo apt-get install libpq-dev

on arch:

sudo pacman -Sy postgresql-libs

source

on Amazon Linux:

sudo yum -y install gcc python-setuptools python-devel postgresql-devel

source

  1. Set environment variables

Environment variables can be seen in Required variables part or in .env.example file

  1. Run programm

To run programm use simple command depending on your configuration:

python main.py

If you want to save logs in main.log, you can use --log-file arg

python main.py --log-file

Or use virtual environment variables AND docker

Required variables

Database configuration

If you’re using mongodb

:warning: mongodb isn’t being tested: try on your own risk

If you’re using postgresql

Telegram bot configuration

Long polling

Webhook

If you’re encountering issues, read aiogram documentation or official telegram documentation

Migration, database testing, updating

Run db_cli.py script to execute sql from “sql_queries” folder.

When using choose script to execute by entering its number or quit by entering “q”

Resources