diff --git a/README.rst b/README.rst index 3c46ba2b8..5ccc9ffbf 100644 --- a/README.rst +++ b/README.rst @@ -226,7 +226,7 @@ To create an instance of the ``telegram.Bot``:: To see if your credentials are successful:: - >>> print bot.getMe() + >>> print(bot.getMe()) {"first_name": "Toledo's Palace Bot", "username": "ToledosPalaceBot"} Bots can't initiate conversations with users. A user must either add them to a group or send them a message first. People can use ``telegram.me/`` links or username search to find your bot. @@ -234,12 +234,12 @@ Bots can't initiate conversations with users. A user must either add them to a g To fetch text messages sent to your Bot:: >>> updates = bot.getUpdates() - >>> print [u.message.text for u in updates] + >>> print([u.message.text for u in updates]) To fetch images sent to your Bot:: >>> updates = bot.getUpdates() - >>> print [u.message.photo for u in updates if u.message.photo] + >>> print([u.message.photo for u in updates if u.message.photo]) To reply messages you'll always need the chat_id:: diff --git a/telegram/ext/dispatcher.py b/telegram/ext/dispatcher.py index 26659d4b5..8555cdf29 100644 --- a/telegram/ext/dispatcher.py +++ b/telegram/ext/dispatcher.py @@ -639,7 +639,7 @@ class Dispatcher: Dispatches an error. Args: - update (any): The pdate that caused the error + update (any): The update that caused the error error (telegram.TelegramError): The Telegram error that was raised. """ diff --git a/telegram/utils/request.py b/telegram/utils/request.py index d418bbd9b..cac766a4d 100644 --- a/telegram/utils/request.py +++ b/telegram/utils/request.py @@ -83,7 +83,7 @@ def _try_except_req(func): if errcode in (401, 403): raise Unauthorized() - if errcode == 502: + elif errcode == 502: raise NetworkError('Bad Gateway') try: