diff --git a/compiler/error/source/400_BAD_REQUEST.tsv b/compiler/error/source/400_BAD_REQUEST.tsv index 82726bd3..73445b5e 100644 --- a/compiler/error/source/400_BAD_REQUEST.tsv +++ b/compiler/error/source/400_BAD_REQUEST.tsv @@ -130,4 +130,5 @@ CHANNELS_TOO_MUCH You have joined too many channels or supergroups ADMIN_RANK_INVALID The custom administrator title is invalid or is longer than 16 characters ADMIN_RANK_EMOJI_NOT_ALLOWED Emojis are not allowed in custom administrator titles FILE_REFERENCE_EMPTY The file reference is empty -FILE_REFERENCE_INVALID The file reference is invalid \ No newline at end of file +FILE_REFERENCE_INVALID The file reference is invalid +REPLY_MARKUP_TOO_LONG The reply markup is too long diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 203dde8a..cc9e5b60 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -253,6 +253,19 @@ contact people using official apps. The answer is the same for Pyrogram too and for usernames, meeting them in a common group, have their phone contacts saved or getting a message mentioning them, either a forward or a mention in the message text. +Code hangs when I stop, restart, add/remove_handler +--------------------------------------------------- + +You tried to ``.stop()``, ``.restart()``, ``.add_handler()`` or ``.remove_handler()`` *inside* a running handler, but +that can't be done because the way Pyrogram deals with handlers would make it hang. + +When calling one of the methods above inside an event handler, Pyrogram needs to wait for all running handlers to finish +in order to safely continue. In other words, since your handler is blocking the execution by waiting for the called +method to finish and since Pyrogram needs to wait for your handler to finish, you are left with a deadlock. + +The solution to this problem is to pass ``block=False`` to such methods so that they return immediately and the actual +code called asynchronously. + UnicodeEncodeError: '' codec can't encode … ----------------------------------------------------- diff --git a/docs/source/topics/mtproto-vs-botapi.rst b/docs/source/topics/mtproto-vs-botapi.rst index cad84251..b0e46a7f 100644 --- a/docs/source/topics/mtproto-vs-botapi.rst +++ b/docs/source/topics/mtproto-vs-botapi.rst @@ -73,12 +73,6 @@ HTTP Bot API. Using Pyrogram you can: - :guilabel:`--` The Bot API types often miss some useful information about Telegram entities and some of the methods are limited as well. -.. hlist:: - :columns: 1 - - - :guilabel:`+` **Get information about any public chat by usernames, even if not a member** - - :guilabel:`--` The Bot API simply doesn't support this - .. hlist:: :columns: 1 diff --git a/pyrogram/client/handlers/disconnect_handler.py b/pyrogram/client/handlers/disconnect_handler.py index 1b4801b2..ab2cf342 100644 --- a/pyrogram/client/handlers/disconnect_handler.py +++ b/pyrogram/client/handlers/disconnect_handler.py @@ -21,7 +21,7 @@ from .handler import Handler class DisconnectHandler(Handler): """The Disconnect handler class. Used to handle disconnections. It is intended to be used with - :meth:~Client.add_handler` + :meth:`~Client.add_handler` For a nicer way to register this handler, have a look at the :meth:`~Client.on_disconnect` decorator.