diff --git a/examples/echobot.py b/examples/echobot.py index dc07df4a3..4834ca2e2 100644 --- a/examples/echobot.py +++ b/examples/echobot.py @@ -24,7 +24,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 + message = update.message.text.encode('utf-8') if (message): # Reply the message diff --git a/telegram/bot.py b/telegram/bot.py index 6aa6874a6..89c675822 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -50,6 +50,8 @@ class Bot(TelegramObject): self.username = bot.username self.__auth = True + + self.log.info('Starting bot %s' % self.name) except TelegramError: raise TelegramError({'message': 'Bad token'}) @@ -533,6 +535,12 @@ class Bot(TelegramObject): json_data = self._requestUrl(url, 'POST', data=data) data = self._parseAndCheckTelegram(json_data) + if data: + self.log.info( + 'Getting updates: %s' % [u['update_id'] for u in data]) + else: + self.log.info('No new updates found.') + return [Update.de_json(x) for x in data] @log