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-devon arch:
sudo pacman -Sy postgresql-libson Amazon Linux:
sudo yum -y install gcc python-setuptools python-devel postgresql-develon MacOS:
brew install postgresql
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 or False. If False only shows WARNING level logs.False if you want to use long pollingTrueIf you’re using self-signed certificate you should add certificate file to
set_webhookmethod inlaunch.pyfile
Make sure your user can read the file, otherwise the PermissionError will be raised
Optional
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”