mimicmobile / flask-telegram-relay-bot Goto Github PK
View Code? Open in Web Editor NEWA relay bot for Telegram running Flask+Gunicorn
License: MIT License
A relay bot for Telegram running Flask+Gunicorn
License: MIT License
When alert is generated by alertmanager, i receive email amd message to telegram.
In email i have full log with problem, but in telegram i have only this:
Failed to send via Flask to Telegram!
I tried make curl:
curl -k -X POST -d '{"message": "hello" }' http://127.0.0.1:9119/alert
And get this message too: Failed to send via Flask to Telegram!
in logs:
INFO:main:None
DEBUG:telegram.bot:Entering: send_message
DEBUG:telegram.vendor.ptb_urllib3.urllib3.connectionpool:https://api.telegram.org:443 "POST /botxxxxxxxxxxxxxx/sendMessage HTTP/1.1" 200 172
DEBUG:telegram.bot:{'delete_chat_photo': False, 'new_chat_photo': [], 'text': u'Failed to send via Flask to Telegram!', 'channel_chat_created': False, 'caption_entities': [], 'entities': [],
'new_chat_members': [], 'supergroup_chat_created': False, 'chat': {'type': u'channel', 'id': -1001xxxxxxxx, 'title': u'alertmgr_qx'}, 'photo': [], 'date': 1558686604, 'group_chat_created':
False, 'message_id': 102}
DEBUG:telegram.bot:Exiting: send_message
INFO:werkzeug:127.0.0.1 - - [24/May/2019 08:30:04] "POST /alert HTTP/1.1" 200 -
Hi there,
I am getting the following error":
Traceback (most recent call last):
File "/home/fs/.local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/home/fs/.local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/fs/.local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/fs/.local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/fs/.local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/home/fs/.local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/fs/Bots/Telegram/flask-telegram-relay-bot/bot/main.py", line 52, in relay
utils.send_message(chat_id=chat_id, text=parsed_json['message'])
KeyError: 'message'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.