Skip to content

Commit 3c80a10

Browse files
authored
Merge pull request pyrogram#333 from pyrogram/fixes
Various fixes and additions to the documentation
2 parents ec15534 + c33a2a0 commit 3c80a10

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

compiler/error/source/400_BAD_REQUEST.tsv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,5 @@ CHANNELS_TOO_MUCH You have joined too many channels or supergroups
130130
ADMIN_RANK_INVALIDThe custom administrator title is invalid or is longer than 16 characters
131131
ADMIN_RANK_EMOJI_NOT_ALLOWEDEmojis are not allowed in custom administrator titles
132132
FILE_REFERENCE_EMPTYThe file reference is empty
133-
FILE_REFERENCE_INVALIDThe file reference is invalid
133+
FILE_REFERENCE_INVALIDThe file reference is invalid
134+
REPLY_MARKUP_TOO_LONGThe reply markup is too long

docs/source/faq.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,19 @@ contact people using official apps. The answer is the same for Pyrogram too and
253253
for usernames, meeting them in a common group, have their phone contacts saved or getting a message mentioning them,
254254
either a forward or a mention in the message text.
255255

256+
Code hangs when I stop, restart, add/remove_handler
257+
---------------------------------------------------
258+
259+
You tried to ``.stop()``, ``.restart()``, ``.add_handler()`` or ``.remove_handler()`` *inside* a running handler, but
260+
that can't be done because the way Pyrogram deals with handlers would make it hang.
261+
262+
When calling one of the methods above inside an event handler, Pyrogram needs to wait for all running handlers to finish
263+
in order to safely continue. In other words, since your handler is blocking the execution by waiting for the called
264+
method to finish and since Pyrogram needs to wait for your handler to finish, you are left with a deadlock.
265+
266+
The solution to this problem is to pass ``block=False`` to such methods so that they return immediately and the actual
267+
code called asynchronously.
268+
256269
UnicodeEncodeError: '<encoding>' codec can't encode …
257270
-----------------------------------------------------
258271

docs/source/topics/mtproto-vs-botapi.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ HTTP Bot API. Using Pyrogram you can:
7373
- :guilabel:`--` The Bot API types often miss some useful information about Telegram entities and some of the
7474
methods are limited as well.
7575

76-
.. hlist::
77-
:columns: 1
78-
79-
- :guilabel:`+` **Get information about any public chat by usernames, even if not a member**
80-
- :guilabel:`--` The Bot API simply doesn't support this
81-
8276
.. hlist::
8377
:columns: 1
8478

pyrogram/client/handlers/disconnect_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class DisconnectHandler(Handler):
2323
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with
24-
:meth:~Client.add_handler`
24+
:meth:`~Client.add_handler`
2525
2626
For a nicer way to register this handler, have a look at the
2727
:meth:`~Client.on_disconnect` decorator.

0 commit comments

Comments
 (0)