mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
Encode to UTF8 text messages
This commit is contained in:
parent
2cee590ca8
commit
649fbc40c8
2 changed files with 7 additions and 2 deletions
|
@ -21,7 +21,7 @@ def echo():
|
|||
if LAST_UPDATE_ID < update.update_id:
|
||||
# chat_id is required to reply any message
|
||||
chat_id = update.message.chat_id
|
||||
message = update.message.text.encode('utf-8')
|
||||
message = update.message.text
|
||||
|
||||
if (message):
|
||||
# Reply the message
|
||||
|
|
|
@ -82,6 +82,11 @@ class Message(object):
|
|||
else:
|
||||
reply_to_message = None
|
||||
|
||||
if 'text' in data:
|
||||
text = data['text'].encode('utf-8')
|
||||
else:
|
||||
text = None
|
||||
|
||||
if 'audio' in data:
|
||||
from telegram import Audio
|
||||
audio = Audio.de_json(data['audio'])
|
||||
|
@ -143,7 +148,7 @@ class Message(object):
|
|||
forward_from=forward_from,
|
||||
forward_date=data.get('forward_date', None),
|
||||
reply_to_message=reply_to_message,
|
||||
text=data.get('text', None),
|
||||
text=text,
|
||||
audio=audio,
|
||||
document=document,
|
||||
photo=photo,
|
||||
|
|
Loading…
Reference in a new issue