It uses the python-telegram-bot library and pickledb for basic persistence.
Please also check out my other bots, TexBot and GitBot.
The file is prepared to be run by anyone by filling out the blanks in the configuration. The bot currently runs on @jh0ker_welcomebot
- Python 3.4 (may work with earlier versions, untested)
- python-telegram-bot module (tested with version 3.1.0)
- Clone the repo
- Edit
BOTNAME
andTOKEN
inbot.py
- If you want to use webhooks, fill out
BASE_URL
,HOST
andPORT
as well- If you also want to handle SSL with python-telegram-bot, fill out the
CERT
andCERT_KEY
fields and check the section about SSL.
- If you also want to handle SSL with python-telegram-bot, fill out the
- Follow Bot instructions
You can start the server without an SSL context, if this is handled by another programm, like Apache or haproxy. You can leave out the SSL Information in the header and select the appropriate start line in main
.
Please note that you need a valid ssl certificate or a self-signed one. Use openssl req -new -x509 -nodes -newkey rsa:1024 -keyout server.key -out server.crt -days 3650
to generate your own key and certificate.