From be87e4b2b9826fce56661b6f9ff545b55bde3c95 Mon Sep 17 00:00:00 2001 From: Andrey Mishakin Date: Wed, 4 Jan 2017 21:50:09 +0300 Subject: [PATCH] Fix error in webhook flask example --- examples/webhook_examples/webhook_flask_echo_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/webhook_examples/webhook_flask_echo_bot.py b/examples/webhook_examples/webhook_flask_echo_bot.py index 26b189e..92ffa21 100644 --- a/examples/webhook_examples/webhook_flask_echo_bot.py +++ b/examples/webhook_examples/webhook_flask_echo_bot.py @@ -48,9 +48,9 @@ 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().encode('utf-8') + json_string = flask.request.get_data().decode('utf-8') update = telebot.types.Update.de_json(json_string) - bot.process_new_messages([update.message]) + bot.process_new_updates([update]) return '' else: flask.abort(403)