Merge pull request #87 from franciscod/patch-1

Remove `.encode('utf-8')` from echobot
This commit is contained in:
Jannes Höke 2015-11-10 04:58:21 +01:00
commit 90a77ab7a1

View file

@ -51,12 +51,12 @@ def echo(bot):
for update in bot.getUpdates(offset=LAST_UPDATE_ID, timeout=10): for update in bot.getUpdates(offset=LAST_UPDATE_ID, timeout=10):
# chat_id is required to reply any message # chat_id is required to reply any message
chat_id = update.message.chat_id chat_id = update.message.chat_id
message = update.message.text.encode('utf-8') reply_text = update.message.text
if (message): if (reply_text):
# Reply the message # Reply the message
bot.sendMessage(chat_id=chat_id, bot.sendMessage(chat_id=chat_id,
text=message) text=reply_text)
# Updates global offset to get the new updates # Updates global offset to get the new updates
LAST_UPDATE_ID = update.update_id + 1 LAST_UPDATE_ID = update.update_id + 1