A simple telegram bot with flask.
At present, it is mainly used to receive abnormal messages sent by the service and forward the messages to users.
Use AES/CFB encrypt message.
-
Apply to "BotFather" for your bot token
-
write config.yml
-
bot token
-
add your username to whitelist
-
AES key
- You can use "generate_key.py" to generate your own key
-
-
write .env
- DB_USERNAME: root's username
- DB_PASSWORD: root's password
-
docker-compose up -d
docker-compose down
- flask : 11539
- mongodb : 27017
- mongo-express : 8081
-
POST
/send-
Parameters
name info iv AES initial vector encrypted_message encrypted < message and timestamp >
-
-
If API needs iv and encrypted_message
you can use
from utils.security_guard import SecurityGuard security_guard = SecurityGuard() iv, encypt_message = security_guard.encrypt_message(<msg>, <key>)
to get these parameters