Merge pull request #154 from tp6vup54/master

Fix the bug that the return of request.get_data() is not string.
This commit is contained in:
FrankWang 2016-05-02 21:12:29 +08:00
commit 700b869555
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def index():
@app.route(WEBHOOK_URL_PATH, methods=['POST'])
def webhook():
if flask.request.headers.get('content-type') == 'application/json':
json_string = flask.request.get_data()
json_string = flask.request.get_data().decode('utf-8')
update = telebot.types.Update.de_json(json_string)
bot.process_new_messages([update.message])
return ''