Skip to content

Commit 6ead995

Browse files
author
Pietro Albini
committed
Catch unavailable chats in the getChat API call
That should have been done in botogram 0.3, but I forgot... Fixes: GH-71
1 parent b21378c commit 6ead995

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

botogram/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"sendVoice",
2323
"sendLocation",
2424
"sendChatAction",
25+
"getChat",
2526
)
2627

2728

docs/api/bot.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,17 @@ components.
377377
for chat_id in BROADCAST_TO:
378378
bot.chat(chat_id).send(to_send)
379379
380+
If your bot can't access the chat, an exception will be raised. Check out
381+
the documentation about :ref:`unavailable chats <unavailable-chats>` to
382+
learn more about that.
383+
384+
.. versionadded:: 0.3
385+
386+
.. versionchanged:: 0.3.3
387+
388+
If your bot can't access the chat, a ``ChatUnavailableError`` will be
389+
raised.
390+
380391
.. py:method:: send(chat, message[, preview=True, reply_to=None, syntax=None, extra=None, notify=True])
381392
382393
This method sends a message to a specific chat. The chat must be

docs/changelog/0.3.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ botogram 0.3.3
1414

1515
*Bugfix release, not yet released*
1616

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

22+
.. _issue 71: https://github.com/pietroalbini/botogram/issues/71
2023
.. _issue 72: https://github.com/pietroalbini/botogram/issues/72
2124

2225
.. _changelog-0.3.2:

0 commit comments

Comments
 (0)