Heg.ai Telegram bot
python --version >>> Python 3.8.5
linux version >>> Ubuntu 20.0
Telegram API wrapper used: python-telegram-bot
On a AWS Ubuntu 18.04 new machine, below installations are required:
sudo apt-get install gcc libpq-devsudo apt-get install python3-dev python3-pip python3-venv python3-wheelsudo apt install git-allpip3 install wheel
- on console.cloud.google.com add credentials for new service account and get json file
touch newyearbot-service.json- copy everything from json file to newyearbot-service.json
- open newyearbot-service.json and copy client_email, add it as editor to google sheets file
git clone --recurse-submodules https://repo.url repo- clone repocd repo- move to project directory
-
source setup.sh- create and activate virtual environment, install dependencies--devor-dset up development environment with pre-commit formatter, read more about pre-commit
-
cp .env.example .env- create your .env file and insert your values -
openssl req -newkey rsa:2048 -sha256 -nodes -keyout private.key -x509 -days 3650 -out cert.pem- create a self-signed SSL certificate for webhook, read more about ssl for telegram -
python3 -m src.bot- run as python module from top src directory to acsess database layer--web-hookor-wrun on webhook (polling by default)--debugor-ddisable logging to telegram channel if you test locally--serviceor-secho service msgs to any msg or commands