1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fix bytes not string.

This commit is contained in:
FrankWang 2015-10-18 22:03:29 +08:00
parent 7346326bc3
commit 969c5e76ef

View File

@ -44,7 +44,7 @@ class WebhookServer(object):
'content-type' in cherrypy.request.headers and \ 'content-type' in cherrypy.request.headers and \
cherrypy.request.headers['content-type'] == 'application/json': cherrypy.request.headers['content-type'] == 'application/json':
length = int(cherrypy.request.headers['content-length']) length = int(cherrypy.request.headers['content-length'])
json_string = cherrypy.request.body.read(length) json_string = cherrypy.request.body.read(length).decode("utf-8")
update = telebot.types.Update.de_json(json_string) update = telebot.types.Update.de_json(json_string)
bot.process_new_messages([update.message]) bot.process_new_messages([update.message])
return '' return ''