Merge pull request #333 from pyrogram/fixes

Various fixes and additions to the documentation
This commit is contained in:
Dan 2019-10-27 10:31:17 +01:00 committed by GitHub
commit 3c80a10753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 8 deletions

View File

@ -131,3 +131,4 @@ ADMIN_RANK_INVALID The custom administrator title is invalid or is longer than 1
ADMIN_RANK_EMOJI_NOT_ALLOWED Emojis are not allowed in custom administrator titles ADMIN_RANK_EMOJI_NOT_ALLOWED Emojis are not allowed in custom administrator titles
FILE_REFERENCE_EMPTY The file reference is empty FILE_REFERENCE_EMPTY The file reference is empty
FILE_REFERENCE_INVALID The file reference is invalid FILE_REFERENCE_INVALID The file reference is invalid
REPLY_MARKUP_TOO_LONG The reply markup is too long

1 id message
131 ADMIN_RANK_EMOJI_NOT_ALLOWED Emojis are not allowed in custom administrator titles
132 FILE_REFERENCE_EMPTY The file reference is empty
133 FILE_REFERENCE_INVALID The file reference is invalid
134 REPLY_MARKUP_TOO_LONG The reply markup is too long

View File

@ -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, 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. 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: '<encoding>' codec can't encode … UnicodeEncodeError: '<encoding>' codec can't encode …
----------------------------------------------------- -----------------------------------------------------

View File

@ -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 - :guilabel:`--` The Bot API types often miss some useful information about Telegram entities and some of the
methods are limited as well. 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:: .. hlist::
:columns: 1 :columns: 1

View File

@ -21,7 +21,7 @@ from .handler import Handler
class DisconnectHandler(Handler): class DisconnectHandler(Handler):
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with """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 For a nicer way to register this handler, have a look at the
:meth:`~Client.on_disconnect` decorator. :meth:`~Client.on_disconnect` decorator.