You can inspect a live version of the code in the telegram bot @dleraebot.
$ git clone https://github.com/studentenherz/dleraebot.git$ pip install -r requirements.txtMake a copy of the file:
credentials.py.sampleAnd name it:
credentials.pyEdit your bot token in the file. If you don't have one, you can get it using @BotFather in Telegram.
Here the bot is set to use webhooks, with an aiohttp server through gunicorn
$ gunicorn app:app -k aiohttp.worker.GunicornWebWorker -b <host>:<port>See this to learn how to set up the webserver with nginx + gunicorn.
Then, for database update and daily boradcast of the Word Of The Day, schedule the cronjob.py in the crontab:
$ crontab -e should have two lines like these:
* * * * * path/to/your/env/python /path/to/the/code/cronjob.py # update database every minute
0 12 * * * path/to/your/env/python /path/to/the/code/cronjob.py --broadcast # broadcast every day at 12:00