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.
git clone https://github.com/RoLO0u/sticker-bot.git
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
on Amazon Linux:
sudo yum -y install gcc python-setuptools python-devel postgresql-devel
Environment variables can be seen in Required variables part or in .env.example file
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
In current version either “mongodb” or “postgresql”
:warning: mongodb isn’t being tested: try on your own risk
CREATE DATABASE aiogram; -- or another database name
Use @BotFather to get bot token
True
allows the bot to use long polling
Additionally, this mode shows
DEBUG
level of logs
False
tells the bot to use webhooks
Additionally, this mode shows
WARNING
level of logs
If you’re using self-signed certificate you should add certificate file to
set_webhook
method inlaunch.py
file
Make sure your user can read the file, otherwise the PermissionError will be raised
If you’re encountering issues, read aiogram documentation or official telegram documentation
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”