Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit a18b176

Browse files
Update Pyrogram to v2.0.51
1 parent a8cd18e commit a18b176

64 files changed

Lines changed: 935 additions & 327 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<br>
66
<b>Telegram MTProto API Framework for Python</b>
77
<br>
8+
<a href="https://pyrogram.org">
9+
Homepage
10+
</a>
11+
812
<a href="https://docs.pyrogram.org">
913
Documentation
1014
</a>

compiler/api/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def start(format: bool = False):
444444
sub_type = arg_type.split("<")[1][:-1]
445445

446446
write_types += "\n "
447-
write_types += f"if self.{arg_name}:\n "
447+
write_types += f"if self.{arg_name} is not None:\n "
448448
write_types += "b.write(Vector(self.{}{}))\n ".format(
449449
arg_name, f", {sub_type.title()}" if sub_type in CORE_TYPES else ""
450450
)

compiler/api/source/main_api.tl

Lines changed: 148 additions & 53 deletions
Large diffs are not rendered by default.

compiler/docs/compiler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def get_title_list(s: str) -> list:
194194
get_discussion_message
195195
get_discussion_replies
196196
get_discussion_replies_count
197+
get_custom_emoji_stickers
197198
""",
198199
chats="""
199200
Chats
@@ -250,6 +251,8 @@ def get_title_list(s: str) -> list:
250251
block_user
251252
unblock_user
252253
get_common_chats
254+
get_default_emoji_statuses
255+
set_emoji_status
253256
""",
254257
invite_links="""
255258
Invite Links
@@ -384,6 +387,7 @@ def get_title_list(s: str) -> list:
384387
ChatJoiner
385388
Dialog
386389
Restriction
390+
EmojiStatus
387391
""",
388392
messages_media="""
389393
Messages & Media
@@ -412,6 +416,8 @@ def get_title_list(s: str) -> list:
412416
VideoChatEnded
413417
VideoChatMembersInvited
414418
WebAppData
419+
MessageReactions
420+
ChatReactions
415421
""",
416422
bot_keyboards="""
417423
Bot keyboards

compiler/errors/source/400_BAD_REQUEST.tsv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ START_PARAM_EMPTY The start parameter is empty
285285
START_PARAM_INVALID The start parameter is invalid
286286
START_PARAM_TOO_LONG The start parameter is too long
287287
STICKERSET_INVALID The requested sticker set is invalid
288+
STICKERSET_NOT_MODIFIED The sticker set is not modified
288289
STICKERS_EMPTY The sticker provided is empty
290+
STICKERS_TOO_MUCH Too many stickers in the set
289291
STICKER_DOCUMENT_INVALID The sticker document is invalid
290292
STICKER_EMOJI_INVALID The sticker emoji is invalid
291293
STICKER_FILE_INVALID The sticker file is invalid
@@ -294,6 +296,7 @@ STICKER_INVALID The provided sticker is invalid
294296
STICKER_PNG_DIMENSIONS The sticker png dimensions are invalid
295297
STICKER_PNG_NOPNG Stickers must be png files but the provided image was not a png
296298
STICKER_TGS_NOTGS A tgs sticker file was expected, but something else was provided
299+
STICKER_VIDEO_NOWEBM A webm video file was expected, but something else was provided
297300
STICKER_THUMB_PNG_NOPNG A png sticker thumbnail file was expected, but something else was provided
298301
TAKEOUT_INVALID The takeout id is invalid
299302
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
@@ -349,4 +352,5 @@ WEBDOCUMENT_URL_EMPTY The web document URL is empty
349352
WEBDOCUMENT_URL_INVALID The web document URL is invalid
350353
WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
351354
WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
352-
YOU_BLOCKED_USER You blocked this user
355+
YOU_BLOCKED_USER You blocked this user
356+
ENTITY_BOUNDS_INVALID The message entity bounds are invalid

compiler/errors/source/403_FORBIDDEN.tsv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ USER_INVALID The provided user is invalid
2424
USER_IS_BLOCKED The user is blocked
2525
USER_NOT_MUTUAL_CONTACT The provided user is not a mutual contact
2626
USER_PRIVACY_RESTRICTED The user's privacy settings is preventing you to perform this action
27-
USER_RESTRICTED You are limited/restricted. You can't perform this action
27+
USER_RESTRICTED You are limited/restricted. You can't perform this action
28+
PREMIUM_ACCOUNT_REQUIRED This action requires a premium account

docs/source/faq/how-to-avoid-flood-waits.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following shows how to catch the exception in your code and wait the require
99

1010
.. code-block:: python
1111
12-
import time
12+
import asyncio
1313
from pyrogram.errors import FloodWait
1414
1515
...
@@ -20,4 +20,4 @@ The following shows how to catch the exception in your code and wait the require
2020
...
2121
2222
23-
More info about error handling can be found :doc:`here <../start/errors>`.
23+
More info about error handling can be found :doc:`here <../start/errors>`.

docs/source/faq/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This FAQ page provides answers to common questions about Pyrogram and, to some e
1919
- :doc:`uploading-with-urls-gives-error-webpage-curl-failed`
2020
- :doc:`sqlite3-operationalerror-database-is-locked`
2121
- :doc:`sqlite3-interfaceerror-error-binding-parameter`
22-
- :doc:`socket-send-raised-exception-oserror-timeouterror`
22+
- :doc:`socket-send-oserror-timeouterror-connection-lost-reset`
2323
- :doc:`how-to-avoid-flood-waits`
2424
- :doc:`the-account-has-been-limited-deactivated`
2525

@@ -40,6 +40,6 @@ This FAQ page provides answers to common questions about Pyrogram and, to some e
4040
uploading-with-urls-gives-error-webpage-curl-failed
4141
sqlite3-operationalerror-database-is-locked
4242
sqlite3-interfaceerror-error-binding-parameter
43-
socket-send-raised-exception-oserror-timeouterror
43+
socket-send-oserror-timeouterror-connection-lost-reset
4444
how-to-avoid-flood-waits
4545
the-account-has-been-limited-deactivated
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
socket.send(), OSError(), TimeoutError(), Connection lost/reset
2+
===============================================================
3+
4+
If you get any of these errors chances are you ended up with a slow or inconsistent network connection.
5+
Another reason could be because you are blocking the event loop for too long.
6+
7+
You can consider the following:
8+
9+
- Use Pyrogram asynchronously in its intended way.
10+
- Use shorter non-asynchronous processing loops.
11+
- Use ``asyncio.sleep()`` instead of ``time.sleep()``.
12+
- Use a stable network connection.

docs/source/faq/socket-send-raised-exception-oserror-timeouterror.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)