Skip to content

Commit

Permalink
Catch unavailable chats in the getChat API call
Browse files Browse the repository at this point in the history
That should have been done in botogram 0.3, but I forgot...

Fixes: GH-71
  • Loading branch information
Pietro Albini committed Jul 5, 2016
1 parent b21378c commit 6ead995
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions botogram/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"sendVoice",
"sendLocation",
"sendChatAction",
"getChat",
)


Expand Down
11 changes: 11 additions & 0 deletions docs/api/bot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ components.
for chat_id in BROADCAST_TO:
bot.chat(chat_id).send(to_send)
If your bot can't access the chat, an exception will be raised. Check out
the documentation about :ref:`unavailable chats <unavailable-chats>` to
learn more about that.

.. versionadded:: 0.3

.. versionchanged:: 0.3.3

If your bot can't access the chat, a ``ChatUnavailableError`` will be
raised.

.. py:method:: send(chat, message[, preview=True, reply_to=None, syntax=None, extra=None, notify=True])
This method sends a message to a specific chat. The chat must be
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog/0.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ botogram 0.3.3

*Bugfix release, not yet released*

* Fix unavailable chats not detected when calling :py:meth:`botogram.Bot.chat`
(`issue 71`_)
* Fix broken detection of unavailable chats, due to changes in the Bot API
(`issue 72`_)

.. _issue 71: https://github.com/pietroalbini/botogram/issues/71
.. _issue 72: https://github.com/pietroalbini/botogram/issues/72

.. _changelog-0.3.2:
Expand Down

0 comments on commit 6ead995

Please sign in to comment.