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:
parent
7346326bc3
commit
969c5e76ef
@ -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 ''
|
||||||
|
Loading…
Reference in New Issue
Block a user