Giter Site home page Giter Site logo

mimicmobile / flask-telegram-relay-bot Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 3.0 26 KB

A relay bot for Telegram running Flask+Gunicorn

License: MIT License

Python 74.22% Shell 21.11% Dockerfile 4.67%
django flask gunicorn json python telegram telegram-bot

flask-telegram-relay-bot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flask-telegram-relay-bot's Issues

Error message

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 -

error

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.