small improvements

This commit is contained in:
Rahiel Kasim 2016-04-02 23:13:49 +02:00
parent ba0ea4f268
commit 01b90e7ede
3 changed files with 5 additions and 5 deletions

View file

@ -226,7 +226,7 @@ To create an instance of the ``telegram.Bot``::
To see if your credentials are successful:: To see if your credentials are successful::
>>> print bot.getMe() >>> print(bot.getMe())
{"first_name": "Toledo's Palace Bot", "username": "ToledosPalaceBot"} {"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/<bot_username>`` links or username search to find your bot. 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/<bot_username>`` 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:: To fetch text messages sent to your Bot::
>>> updates = bot.getUpdates() >>> 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:: To fetch images sent to your Bot::
>>> updates = bot.getUpdates() >>> 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:: To reply messages you'll always need the chat_id::

View file

@ -639,7 +639,7 @@ class Dispatcher:
Dispatches an error. Dispatches an error.
Args: 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. error (telegram.TelegramError): The Telegram error that was raised.
""" """

View file

@ -83,7 +83,7 @@ def _try_except_req(func):
if errcode in (401, 403): if errcode in (401, 403):
raise Unauthorized() raise Unauthorized()
if errcode == 502: elif errcode == 502:
raise NetworkError('Bad Gateway') raise NetworkError('Bad Gateway')
try: try: