WPyrogram 2.0.141__py3-none-any.whl → 2.0.143__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/METADATA +1 -1
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/RECORD +13 -13
- pyrogram/__init__.py +1 -1
- pyrogram/errors/exceptions/__init__.py +3 -3
- pyrogram/errors/exceptions/all.py +69 -69
- pyrogram/methods/chats/get_forum_topics_by_id.py +21 -4
- pyrogram/methods/messages/download_media.py +6 -1
- pyrogram/types/messages_and_media/message.py +6 -2
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/COPYING +0 -0
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/COPYING.lesser +0 -0
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/NOTICE +0 -0
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/WHEEL +0 -0
- {WPyrogram-2.0.141.dist-info → WPyrogram-2.0.143.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: WPyrogram
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.143
|
|
4
4
|
Summary: Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots - Woto's experimental fork
|
|
5
5
|
Home-page: https://github.com/ALiwoto/WPyrogram
|
|
6
6
|
Download-URL: https://github.com/ALiwoto/WPyrogram
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pyrogram/__init__.py,sha256=
|
|
1
|
+
pyrogram/__init__.py,sha256=0d4ArxJBNcIzNYcIeVuHYUYxYJl5XbQG_lhOei5atvA,1401
|
|
2
2
|
pyrogram/client.py,sha256=kk_bGK_L9x_gI74d4IIcTEX9kf5I3Njm8CJoAGjMlks,50349
|
|
3
3
|
pyrogram/dispatcher.py,sha256=9K7Li90cnJmoW570HL925o7eaRBRN-kv0lsrPxmZcMg,14813
|
|
4
4
|
pyrogram/emoji.py,sha256=ixb3OXR1XpLf3BQpw8kWIpmbQRowRIaFedjdnuzljac,208021
|
|
@@ -46,8 +46,8 @@ pyrogram/enums/stories_privacy_rules.py,sha256=28__QA0xwKwj5nK3W9cKVBZrwzIj7BHDa
|
|
|
46
46
|
pyrogram/enums/user_status.py,sha256=0WEpJJmjfGsJ3CVEhItO3Zc1VP9CBjgZBpxWUOzoFFg,1299
|
|
47
47
|
pyrogram/errors/__init__.py,sha256=Td5_TRqn2Ht6R3ZTxrLJaL_HoaugITxNCsiYEfueqCw,2605
|
|
48
48
|
pyrogram/errors/rpc_error.py,sha256=18YbiYLQ-wKBZJ389SfPpl0pwQMHn4Xzh0leuZ-vuNU,3315
|
|
49
|
-
pyrogram/errors/exceptions/__init__.py,sha256=
|
|
50
|
-
pyrogram/errors/exceptions/all.py,sha256=
|
|
49
|
+
pyrogram/errors/exceptions/__init__.py,sha256=8IO_U12kcZ4iHO_qVUr9HqEYkVtNaJKcge08D7h837g,1066
|
|
50
|
+
pyrogram/errors/exceptions/all.py,sha256=xMdjtc4FITtMBn4bNP8oyWjEpdRoabxQduxkT_KaL_k,27767
|
|
51
51
|
pyrogram/errors/exceptions/bad_request_400.py,sha256=-aDwF2vMFxXcud0xSu4j2hranOixYN9r6sj1OrldQYY,68924
|
|
52
52
|
pyrogram/errors/exceptions/flood_420.py,sha256=-yad_Z0EGZ2grz_52J0OMc2D1IiNyiM32KNOaL6KCb0,2309
|
|
53
53
|
pyrogram/errors/exceptions/forbidden_403.py,sha256=DDHtBdJuMi0VVjKg-z36ZHGKcSCl4942SscPzZ8k7eo,7913
|
|
@@ -139,7 +139,7 @@ pyrogram/methods/chats/get_dialogs.py,sha256=sfDUfWxvC6cOT9BFxur81tr1NeIfbq8szYz
|
|
|
139
139
|
pyrogram/methods/chats/get_dialogs_count.py,sha256=0JagwclwbH6ws3jkMvyGbtjmsYFbWWBTKJUPz43Knjs,2096
|
|
140
140
|
pyrogram/methods/chats/get_folders.py,sha256=YGMNvjrbqipEUJuSpVFDi5GsUv-ucBgEe5adXH2Nokw,3603
|
|
141
141
|
pyrogram/methods/chats/get_forum_topics.py,sha256=AjY3EzZohPtm2ollJVXEn7VGQc-3oICsjdXoDBuTrHY,3284
|
|
142
|
-
pyrogram/methods/chats/get_forum_topics_by_id.py,sha256=
|
|
142
|
+
pyrogram/methods/chats/get_forum_topics_by_id.py,sha256=fF2Y4kciOdGRx_nnwFgf0RDZcnnJaib6gGxKqu6taQY,3778
|
|
143
143
|
pyrogram/methods/chats/get_nearby_chats.py,sha256=sOoNjQ9qHKzD4UYoVusMM5G65KnqzqpzzwLwByJf6tc,2401
|
|
144
144
|
pyrogram/methods/chats/get_send_as_chats.py,sha256=bY6VQnm3J6nezq5lhaBtPxu5-Co-Ti2sZki2XW5Q8JI,2151
|
|
145
145
|
pyrogram/methods/chats/get_similar_channels.py,sha256=99BNdyr-XbcRUviGXSbjIBJq1vU7hZq9g5vs-JIJt64,2076
|
|
@@ -213,7 +213,7 @@ pyrogram/methods/messages/__init__.py,sha256=btSd4x5HrQ9hwM6G85cjh1fk2EoSp0d7gE_
|
|
|
213
213
|
pyrogram/methods/messages/copy_media_group.py,sha256=rEqKAhP0mwnQcwLptabfHQHntxUD24rCUtUFymDAsvw,8148
|
|
214
214
|
pyrogram/methods/messages/copy_message.py,sha256=-6JU8y74AwllMIzRljujrErk1SjdlaI3i3EzZUMbTVk,5884
|
|
215
215
|
pyrogram/methods/messages/delete_messages.py,sha256=PgsVHswsRQ_f9ympNS7DM8-gHHBnnBRw4Du4evqYnJA,3148
|
|
216
|
-
pyrogram/methods/messages/download_media.py,sha256=
|
|
216
|
+
pyrogram/methods/messages/download_media.py,sha256=m1oIAA9vwnEBT1q_7ylCAn7gmPGd2-jK0L67D8i6fl4,8131
|
|
217
217
|
pyrogram/methods/messages/edit_inline_caption.py,sha256=dmr8PNbsk1J_N5PPsHowfiAQqeVkUA-JfOOWZlgw_Ho,2271
|
|
218
218
|
pyrogram/methods/messages/edit_inline_media.py,sha256=AKFMKLfgvyJvVhMCfmIRqMQpQBWgpSr_f-rBvzJtCp4,10468
|
|
219
219
|
pyrogram/methods/messages/edit_inline_reply_markup.py,sha256=4HjFqTkm5mcbuj_D82q-wiQKXemgeWfR4lF-S-LTbJU,2464
|
|
@@ -2895,7 +2895,7 @@ pyrogram/types/messages_and_media/gift_code.py,sha256=aQ5q46q1vEWdp3o8VuLrXGaXHk
|
|
|
2895
2895
|
pyrogram/types/messages_and_media/giveaway.py,sha256=WYzjT45XGjdxosaiEw0HZiGNkZ4QiG4I8OWIgN9HpLM,3662
|
|
2896
2896
|
pyrogram/types/messages_and_media/giveaway_result.py,sha256=l8yZvXBPdCHLKChHjVrB0nSHK4NCaDc3YOm97q9bnY4,4745
|
|
2897
2897
|
pyrogram/types/messages_and_media/location.py,sha256=IYwxV-4iv1sPQiil3wimLhf6mYl-pwfb5d_MzCc_R-Y,1660
|
|
2898
|
-
pyrogram/types/messages_and_media/message.py,sha256=
|
|
2898
|
+
pyrogram/types/messages_and_media/message.py,sha256=b_cSm2mvVBJYTFni9Gh5skBqCV0H3u-wE7LMdp2yN4U,186030
|
|
2899
2899
|
pyrogram/types/messages_and_media/message_entity.py,sha256=nMhl8n690ItTUTd7RjGrnSzWwKCjnFUpMEq1sDcXaAQ,4352
|
|
2900
2900
|
pyrogram/types/messages_and_media/message_entity_type.py,sha256=tsAs7zQ_QuAQ2eCV5L9oQmXltJ3VpLUn5suZVJ_RbLs,2464
|
|
2901
2901
|
pyrogram/types/messages_and_media/message_media_type.py,sha256=EgSJKsJm4SYjMOx-ce-m3EWMNVCrBPZkrSGmJqDPPr4,1599
|
|
@@ -2955,10 +2955,10 @@ pyrogram/types/user_and_chats/video_chat_ended.py,sha256=J5xTIAMSGDz8_z-EGrKwkoJ
|
|
|
2955
2955
|
pyrogram/types/user_and_chats/video_chat_members_invited.py,sha256=9QhonApJd1XjOeJu9fqx2_u6nIOTZhfXZw_tX9XXxd8,1610
|
|
2956
2956
|
pyrogram/types/user_and_chats/video_chat_scheduled.py,sha256=rUvDXF8r-2MfsAZKAcaWb_UZt5VoHebPjeJXWRDHGSo,1531
|
|
2957
2957
|
pyrogram/types/user_and_chats/video_chat_started.py,sha256=WOAuM_CnkRA-W_Iedx0fIHB9RJ-AsvJIiSF05HzLRdA,1043
|
|
2958
|
-
WPyrogram-2.0.
|
|
2959
|
-
WPyrogram-2.0.
|
|
2960
|
-
WPyrogram-2.0.
|
|
2961
|
-
WPyrogram-2.0.
|
|
2962
|
-
WPyrogram-2.0.
|
|
2963
|
-
WPyrogram-2.0.
|
|
2964
|
-
WPyrogram-2.0.
|
|
2958
|
+
WPyrogram-2.0.143.dist-info/COPYING,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
|
2959
|
+
WPyrogram-2.0.143.dist-info/COPYING.lesser,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
|
|
2960
|
+
WPyrogram-2.0.143.dist-info/METADATA,sha256=Iwy1pXOO1eKYbSawQHVsfcyRMxqvdfEiZ9qMI0pt_44,4924
|
|
2961
|
+
WPyrogram-2.0.143.dist-info/NOTICE,sha256=QL3iJdeVh_ZqRZZchyruQic5bYUWdx3yl0OkSUC2PQc,774
|
|
2962
|
+
WPyrogram-2.0.143.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
2963
|
+
WPyrogram-2.0.143.dist-info/top_level.txt,sha256=vS2-tKX7dJ1uKjistE5CoOVbv4yqglA95SK0KFEDwl0,9
|
|
2964
|
+
WPyrogram-2.0.143.dist-info/RECORD,,
|
pyrogram/__init__.py
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
|
17
17
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
|
|
19
|
-
__version__ = "2.0.
|
|
19
|
+
__version__ = "2.0.143"
|
|
20
20
|
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
|
|
21
21
|
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"
|
|
22
22
|
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License
|
|
17
17
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
|
|
19
|
-
from .unauthorized_401 import *
|
|
20
|
-
from .forbidden_403 import *
|
|
21
19
|
from .see_other_303 import *
|
|
22
20
|
from .internal_server_error_500 import *
|
|
21
|
+
from .unauthorized_401 import *
|
|
23
22
|
from .service_unavailable_503 import *
|
|
24
|
-
from .not_acceptable_406 import *
|
|
25
23
|
from .bad_request_400 import *
|
|
24
|
+
from .not_acceptable_406 import *
|
|
26
25
|
from .flood_420 import *
|
|
26
|
+
from .forbidden_403 import *
|
|
@@ -19,58 +19,6 @@
|
|
|
19
19
|
count = 505
|
|
20
20
|
|
|
21
21
|
exceptions = {
|
|
22
|
-
401: {
|
|
23
|
-
"_": "Unauthorized",
|
|
24
|
-
"ACTIVE_USER_REQUIRED": "ActiveUserRequired",
|
|
25
|
-
"AUTH_KEY_INVALID": "AuthKeyInvalid",
|
|
26
|
-
"AUTH_KEY_PERM_EMPTY": "AuthKeyPermEmpty",
|
|
27
|
-
"AUTH_KEY_UNREGISTERED": "AuthKeyUnregistered",
|
|
28
|
-
"SESSION_EXPIRED": "SessionExpired",
|
|
29
|
-
"SESSION_PASSWORD_NEEDED": "SessionPasswordNeeded",
|
|
30
|
-
"SESSION_REVOKED": "SessionRevoked",
|
|
31
|
-
"USER_DEACTIVATED": "UserDeactivated",
|
|
32
|
-
"USER_DEACTIVATED_BAN": "UserDeactivatedBan",
|
|
33
|
-
},
|
|
34
|
-
403: {
|
|
35
|
-
"_": "Forbidden",
|
|
36
|
-
"BROADCAST_FORBIDDEN": "BroadcastForbidden",
|
|
37
|
-
"CHANNEL_PUBLIC_GROUP_NA": "ChannelPublicGroupNa",
|
|
38
|
-
"CHAT_ADMIN_INVITE_REQUIRED": "ChatAdminInviteRequired",
|
|
39
|
-
"CHAT_ADMIN_REQUIRED": "ChatAdminRequired",
|
|
40
|
-
"CHAT_FORBIDDEN": "ChatForbidden",
|
|
41
|
-
"CHAT_GUEST_SEND_FORBIDDEN": "ChatGuestSendForbidden",
|
|
42
|
-
"CHAT_SEND_AUDIOS_FORBIDDEN": "ChatSendAudiosForbidden",
|
|
43
|
-
"CHAT_SEND_GAME_FORBIDDEN": "ChatSendGameForbidden",
|
|
44
|
-
"CHAT_SEND_GIFS_FORBIDDEN": "ChatSendGifsForbidden",
|
|
45
|
-
"CHAT_SEND_INLINE_FORBIDDEN": "ChatSendInlineForbidden",
|
|
46
|
-
"CHAT_SEND_MEDIA_FORBIDDEN": "ChatSendMediaForbidden",
|
|
47
|
-
"CHAT_SEND_PHOTOS_FORBIDDEN": "ChatSendPhotosForbidden",
|
|
48
|
-
"CHAT_SEND_PLAIN_FORBIDDEN": "ChatSendPlainForbidden",
|
|
49
|
-
"CHAT_SEND_POLL_FORBIDDEN": "ChatSendPollForbidden",
|
|
50
|
-
"CHAT_SEND_STICKERS_FORBIDDEN": "ChatSendStickersForbidden",
|
|
51
|
-
"CHAT_SEND_VIDEOS_FORBIDDEN": "ChatSendVideosForbidden",
|
|
52
|
-
"CHAT_SEND_VOICES_FORBIDDEN": "ChatSendVoicesForbidden",
|
|
53
|
-
"CHAT_WRITE_FORBIDDEN": "ChatWriteForbidden",
|
|
54
|
-
"EDIT_BOT_INVITE_FORBIDDEN": "EditBotInviteForbidden",
|
|
55
|
-
"GROUPCALL_FORBIDDEN": "GroupcallForbidden",
|
|
56
|
-
"INLINE_BOT_REQUIRED": "InlineBotRequired",
|
|
57
|
-
"LIVE_DISABLED": "LiveDisabled",
|
|
58
|
-
"MESSAGE_AUTHOR_REQUIRED": "MessageAuthorRequired",
|
|
59
|
-
"MESSAGE_DELETE_FORBIDDEN": "MessageDeleteForbidden",
|
|
60
|
-
"POLL_VOTE_REQUIRED": "PollVoteRequired",
|
|
61
|
-
"PREMIUM_ACCOUNT_REQUIRED": "PremiumAccountRequired",
|
|
62
|
-
"PRIVACY_PREMIUM_REQUIRED": "PrivacyPremiumRequired",
|
|
63
|
-
"RIGHT_FORBIDDEN": "RightForbidden",
|
|
64
|
-
"SENSITIVE_CHANGE_FORBIDDEN": "SensitiveChangeForbidden",
|
|
65
|
-
"TAKEOUT_REQUIRED": "TakeoutRequired",
|
|
66
|
-
"USER_BOT_INVALID": "UserBotInvalid",
|
|
67
|
-
"USER_CHANNELS_TOO_MUCH": "UserChannelsTooMuch",
|
|
68
|
-
"USER_INVALID": "UserInvalid",
|
|
69
|
-
"USER_IS_BLOCKED": "UserIsBlocked",
|
|
70
|
-
"USER_NOT_MUTUAL_CONTACT": "UserNotMutualContact",
|
|
71
|
-
"USER_PRIVACY_RESTRICTED": "UserPrivacyRestricted",
|
|
72
|
-
"USER_RESTRICTED": "UserRestricted",
|
|
73
|
-
},
|
|
74
22
|
303: {
|
|
75
23
|
"_": "SeeOther",
|
|
76
24
|
"FILE_MIGRATE_X": "FileMigrate",
|
|
@@ -127,29 +75,24 @@ exceptions = {
|
|
|
127
75
|
"WORKER_BUSY_TOO_LONG_RETRY": "WorkerBusyTooLongRetry",
|
|
128
76
|
"WP_ID_GENERATE_FAILED": "WpIdGenerateFailed",
|
|
129
77
|
},
|
|
78
|
+
401: {
|
|
79
|
+
"_": "Unauthorized",
|
|
80
|
+
"ACTIVE_USER_REQUIRED": "ActiveUserRequired",
|
|
81
|
+
"AUTH_KEY_INVALID": "AuthKeyInvalid",
|
|
82
|
+
"AUTH_KEY_PERM_EMPTY": "AuthKeyPermEmpty",
|
|
83
|
+
"AUTH_KEY_UNREGISTERED": "AuthKeyUnregistered",
|
|
84
|
+
"SESSION_EXPIRED": "SessionExpired",
|
|
85
|
+
"SESSION_PASSWORD_NEEDED": "SessionPasswordNeeded",
|
|
86
|
+
"SESSION_REVOKED": "SessionRevoked",
|
|
87
|
+
"USER_DEACTIVATED": "UserDeactivated",
|
|
88
|
+
"USER_DEACTIVATED_BAN": "UserDeactivatedBan",
|
|
89
|
+
},
|
|
130
90
|
503: {
|
|
131
91
|
"_": "ServiceUnavailable",
|
|
132
92
|
"ApiCallError": "ApiCallError",
|
|
133
93
|
"Timedout": "Timedout",
|
|
134
94
|
"Timeout": "Timeout",
|
|
135
95
|
},
|
|
136
|
-
406: {
|
|
137
|
-
"_": "NotAcceptable",
|
|
138
|
-
"AUTH_KEY_DUPLICATED": "AuthKeyDuplicated",
|
|
139
|
-
"CHANNEL_PRIVATE": "ChannelPrivate",
|
|
140
|
-
"CHANNEL_TOO_LARGE": "ChannelTooLarge",
|
|
141
|
-
"FILEREF_UPGRADE_NEEDED": "FilerefUpgradeNeeded",
|
|
142
|
-
"FRESH_CHANGE_ADMINS_FORBIDDEN": "FreshChangeAdminsForbidden",
|
|
143
|
-
"FRESH_CHANGE_PHONE_FORBIDDEN": "FreshChangePhoneForbidden",
|
|
144
|
-
"FRESH_RESET_AUTHORISATION_FORBIDDEN": "FreshResetAuthorisationForbidden",
|
|
145
|
-
"GIFTCODE_NOT_ALLOWED": "GiftcodeNotAllowed",
|
|
146
|
-
"PHONE_NUMBER_INVALID": "PhoneNumberInvalid",
|
|
147
|
-
"PHONE_PASSWORD_FLOOD": "PhonePasswordFlood",
|
|
148
|
-
"STICKERSET_INVALID": "StickersetInvalid",
|
|
149
|
-
"STICKERSET_OWNER_ANONYMOUS": "StickersetOwnerAnonymous",
|
|
150
|
-
"USERPIC_UPLOAD_REQUIRED": "UserpicUploadRequired",
|
|
151
|
-
"USER_RESTRICTED": "UserRestricted",
|
|
152
|
-
},
|
|
153
96
|
400: {
|
|
154
97
|
"_": "BadRequest",
|
|
155
98
|
"ABOUT_TOO_LONG": "AboutTooLong",
|
|
@@ -538,6 +481,23 @@ exceptions = {
|
|
|
538
481
|
"WEBPAGE_MEDIA_EMPTY": "WebpageMediaEmpty",
|
|
539
482
|
"YOU_BLOCKED_USER": "YouBlockedUser",
|
|
540
483
|
},
|
|
484
|
+
406: {
|
|
485
|
+
"_": "NotAcceptable",
|
|
486
|
+
"AUTH_KEY_DUPLICATED": "AuthKeyDuplicated",
|
|
487
|
+
"CHANNEL_PRIVATE": "ChannelPrivate",
|
|
488
|
+
"CHANNEL_TOO_LARGE": "ChannelTooLarge",
|
|
489
|
+
"FILEREF_UPGRADE_NEEDED": "FilerefUpgradeNeeded",
|
|
490
|
+
"FRESH_CHANGE_ADMINS_FORBIDDEN": "FreshChangeAdminsForbidden",
|
|
491
|
+
"FRESH_CHANGE_PHONE_FORBIDDEN": "FreshChangePhoneForbidden",
|
|
492
|
+
"FRESH_RESET_AUTHORISATION_FORBIDDEN": "FreshResetAuthorisationForbidden",
|
|
493
|
+
"GIFTCODE_NOT_ALLOWED": "GiftcodeNotAllowed",
|
|
494
|
+
"PHONE_NUMBER_INVALID": "PhoneNumberInvalid",
|
|
495
|
+
"PHONE_PASSWORD_FLOOD": "PhonePasswordFlood",
|
|
496
|
+
"STICKERSET_INVALID": "StickersetInvalid",
|
|
497
|
+
"STICKERSET_OWNER_ANONYMOUS": "StickersetOwnerAnonymous",
|
|
498
|
+
"USERPIC_UPLOAD_REQUIRED": "UserpicUploadRequired",
|
|
499
|
+
"USER_RESTRICTED": "UserRestricted",
|
|
500
|
+
},
|
|
541
501
|
420: {
|
|
542
502
|
"_": "Flood",
|
|
543
503
|
"2FA_CONFIRM_WAIT_X": "TwoFaConfirmWait",
|
|
@@ -548,4 +508,44 @@ exceptions = {
|
|
|
548
508
|
"STORY_SEND_FLOOD_X": "StorySendFlood",
|
|
549
509
|
"TAKEOUT_INIT_DELAY_X": "TakeoutInitDelay",
|
|
550
510
|
},
|
|
511
|
+
403: {
|
|
512
|
+
"_": "Forbidden",
|
|
513
|
+
"BROADCAST_FORBIDDEN": "BroadcastForbidden",
|
|
514
|
+
"CHANNEL_PUBLIC_GROUP_NA": "ChannelPublicGroupNa",
|
|
515
|
+
"CHAT_ADMIN_INVITE_REQUIRED": "ChatAdminInviteRequired",
|
|
516
|
+
"CHAT_ADMIN_REQUIRED": "ChatAdminRequired",
|
|
517
|
+
"CHAT_FORBIDDEN": "ChatForbidden",
|
|
518
|
+
"CHAT_GUEST_SEND_FORBIDDEN": "ChatGuestSendForbidden",
|
|
519
|
+
"CHAT_SEND_AUDIOS_FORBIDDEN": "ChatSendAudiosForbidden",
|
|
520
|
+
"CHAT_SEND_GAME_FORBIDDEN": "ChatSendGameForbidden",
|
|
521
|
+
"CHAT_SEND_GIFS_FORBIDDEN": "ChatSendGifsForbidden",
|
|
522
|
+
"CHAT_SEND_INLINE_FORBIDDEN": "ChatSendInlineForbidden",
|
|
523
|
+
"CHAT_SEND_MEDIA_FORBIDDEN": "ChatSendMediaForbidden",
|
|
524
|
+
"CHAT_SEND_PHOTOS_FORBIDDEN": "ChatSendPhotosForbidden",
|
|
525
|
+
"CHAT_SEND_PLAIN_FORBIDDEN": "ChatSendPlainForbidden",
|
|
526
|
+
"CHAT_SEND_POLL_FORBIDDEN": "ChatSendPollForbidden",
|
|
527
|
+
"CHAT_SEND_STICKERS_FORBIDDEN": "ChatSendStickersForbidden",
|
|
528
|
+
"CHAT_SEND_VIDEOS_FORBIDDEN": "ChatSendVideosForbidden",
|
|
529
|
+
"CHAT_SEND_VOICES_FORBIDDEN": "ChatSendVoicesForbidden",
|
|
530
|
+
"CHAT_WRITE_FORBIDDEN": "ChatWriteForbidden",
|
|
531
|
+
"EDIT_BOT_INVITE_FORBIDDEN": "EditBotInviteForbidden",
|
|
532
|
+
"GROUPCALL_FORBIDDEN": "GroupcallForbidden",
|
|
533
|
+
"INLINE_BOT_REQUIRED": "InlineBotRequired",
|
|
534
|
+
"LIVE_DISABLED": "LiveDisabled",
|
|
535
|
+
"MESSAGE_AUTHOR_REQUIRED": "MessageAuthorRequired",
|
|
536
|
+
"MESSAGE_DELETE_FORBIDDEN": "MessageDeleteForbidden",
|
|
537
|
+
"POLL_VOTE_REQUIRED": "PollVoteRequired",
|
|
538
|
+
"PREMIUM_ACCOUNT_REQUIRED": "PremiumAccountRequired",
|
|
539
|
+
"PRIVACY_PREMIUM_REQUIRED": "PrivacyPremiumRequired",
|
|
540
|
+
"RIGHT_FORBIDDEN": "RightForbidden",
|
|
541
|
+
"SENSITIVE_CHANGE_FORBIDDEN": "SensitiveChangeForbidden",
|
|
542
|
+
"TAKEOUT_REQUIRED": "TakeoutRequired",
|
|
543
|
+
"USER_BOT_INVALID": "UserBotInvalid",
|
|
544
|
+
"USER_CHANNELS_TOO_MUCH": "UserChannelsTooMuch",
|
|
545
|
+
"USER_INVALID": "UserInvalid",
|
|
546
|
+
"USER_IS_BLOCKED": "UserIsBlocked",
|
|
547
|
+
"USER_NOT_MUTUAL_CONTACT": "UserNotMutualContact",
|
|
548
|
+
"USER_PRIVACY_RESTRICTED": "UserPrivacyRestricted",
|
|
549
|
+
"USER_RESTRICTED": "UserRestricted",
|
|
550
|
+
},
|
|
551
551
|
}
|
|
@@ -70,16 +70,33 @@ class GetForumTopicsByID:
|
|
|
70
70
|
)
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
topics_list = []
|
|
74
|
+
parsed_messages = {}
|
|
74
75
|
users = {u.id: u for u in getattr(r, "users", [])}
|
|
75
76
|
chats = {c.id: c for c in getattr(r, "chats", [])}
|
|
77
|
+
topics = {t.id: t for t in getattr(r, "topics", [])}
|
|
76
78
|
messages = {m.id: m for m in getattr(r, "messages", [])}
|
|
77
79
|
|
|
78
|
-
for
|
|
79
|
-
|
|
80
|
+
for message in messages.values():
|
|
81
|
+
if isinstance(message, raw.types.MessageEmpty):
|
|
82
|
+
continue
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
parsed_messages[message.id] = await types.Message._parse(
|
|
86
|
+
client=self,
|
|
87
|
+
message=message,
|
|
88
|
+
users=users,
|
|
89
|
+
chats=chats,
|
|
90
|
+
replies=0,
|
|
91
|
+
from_topic=True if len(topics_list) != 1 else topics_list[topic_ids[0]]
|
|
92
|
+
)
|
|
93
|
+
except: pass
|
|
94
|
+
|
|
95
|
+
for current in topics.values():
|
|
96
|
+
topics_list.append(types.ForumTopic._parse(
|
|
80
97
|
self,
|
|
81
98
|
forum_topic=current,
|
|
82
|
-
messages=
|
|
99
|
+
messages=parsed_messages,
|
|
83
100
|
users=users,
|
|
84
101
|
chats=chats
|
|
85
102
|
))
|
|
@@ -104,6 +104,9 @@ class DownloadMedia:
|
|
|
104
104
|
# Download from file id
|
|
105
105
|
await app.download_media(message.photo.file_id)
|
|
106
106
|
|
|
107
|
+
# Download document of a message
|
|
108
|
+
await app.download_media(message.document)
|
|
109
|
+
|
|
107
110
|
# Keep track of the progress while downloading
|
|
108
111
|
async def progress(current, total):
|
|
109
112
|
print(f"{current * 100 / total:.1f}%")
|
|
@@ -138,6 +141,8 @@ class DownloadMedia:
|
|
|
138
141
|
media = getattr(message, message.media.value, None)
|
|
139
142
|
elif isinstance(message, str):
|
|
140
143
|
media = message
|
|
144
|
+
elif hasattr(message, "file_id"):
|
|
145
|
+
media = getattr(message, "file_id")
|
|
141
146
|
|
|
142
147
|
if not media:
|
|
143
148
|
raise ValueError("This message doesn't contain any downloadable media")
|
|
@@ -193,4 +198,4 @@ class DownloadMedia:
|
|
|
193
198
|
if block:
|
|
194
199
|
return await downloader
|
|
195
200
|
else:
|
|
196
|
-
asyncio.get_event_loop().create_task(downloader)
|
|
201
|
+
asyncio.get_event_loop().create_task(downloader)
|
|
@@ -599,7 +599,8 @@ class Message(Object, Update):
|
|
|
599
599
|
chats: dict,
|
|
600
600
|
topics: dict = None,
|
|
601
601
|
is_scheduled: bool = False,
|
|
602
|
-
replies: int = 1
|
|
602
|
+
replies: int = 1,
|
|
603
|
+
from_topic: "types.ForumTopic" = None
|
|
603
604
|
):
|
|
604
605
|
if isinstance(message, raw.types.MessageEmpty):
|
|
605
606
|
return Message(id=message.id, empty=True, client=client, raw=message)
|
|
@@ -1066,6 +1067,9 @@ class Message(Object, Update):
|
|
|
1066
1067
|
if any((isinstance(entity, raw.types.MessageEntityBlockquote) for entity in message.entities)):
|
|
1067
1068
|
parsed_message.quote = True
|
|
1068
1069
|
|
|
1070
|
+
if from_topic:
|
|
1071
|
+
parsed_message.topic = from_topic
|
|
1072
|
+
|
|
1069
1073
|
if message.reply_to:
|
|
1070
1074
|
if isinstance(message.reply_to, raw.types.MessageReplyHeader):
|
|
1071
1075
|
if message.reply_to.forum_topic:
|
|
@@ -1077,7 +1081,7 @@ class Message(Object, Update):
|
|
|
1077
1081
|
|
|
1078
1082
|
parsed_message.message_thread_id = thread_id
|
|
1079
1083
|
|
|
1080
|
-
if topics:
|
|
1084
|
+
if topics and not parsed_message.topic:
|
|
1081
1085
|
parsed_message.topic = types.ForumTopic._parse(client, topics[thread_id], users=users, chats=chats)
|
|
1082
1086
|
else:
|
|
1083
1087
|
if message.reply_to.quote:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|