Starter kit for running a Telegram bot (built with the python-telegram-bot library) on Openshift.
Instructions:
- Register at Openshift. This starter kit works on Openshift online v2 and v3.
- Create a Python3 application.
- Add the following environment variables (for v2 only the TOKEN is needed):
- TOKEN: your telegram bot token
- APP_FILE: wsgi.py
- OPENSHIFT_REPO_DIR: [base dir of the project], i.e. /opt/app-root/src
- OPENSHIFT_GEAR_DNS: [domain of the app], see the hostname of the route
- OPENSHIFT_PYTHON_IP: 0.0.0.0
- OPENSHIFT_PYTHON_PORT: 8080
- Complete the
bot.py
file with your handlers. - Put the
wsgi.py
file at the root of your app directory tree. Thebot.py
file can go anywhere as long as you update theimport
statement in the previous file. - Deploy everything to Openshift.