WPyrogram 2.0.141__py3-none-any.whl → 2.0.142__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: WPyrogram
3
- Version: 2.0.141
3
+ Version: 2.0.142
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=rIRb6DM5FdSaE8gKiX_oZMtjUkIDr33-P90i4fmdpSM,1401
1
+ pyrogram/__init__.py,sha256=myYEqnZT0HMlHALo72oGIuhLQFuT9u1Z-rUITA0b4x0,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
@@ -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=N91zm1viLSmsNqqWS9LAwyxSm8deGAKeKRofoixkq6A,3166
142
+ pyrogram/methods/chats/get_forum_topics_by_id.py,sha256=xlokGhL7SGCXAdHjHFkR0xsm0xzMQSyl5W9nBMxvq4I,3511
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=aaBmAozOz2kwqd0OSrN8J34Ydmap2sPXV1DqC1Kx4fM,7933
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=m9APhWCId1VVfDaYR4bP9LtT9kZJSFpXaY5JvmG4_ig,185864
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.141.dist-info/COPYING,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
2959
- WPyrogram-2.0.141.dist-info/COPYING.lesser,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
2960
- WPyrogram-2.0.141.dist-info/METADATA,sha256=43js35gvEaqWLBpaFmP2X9iOFfeNLKydf9y2VnxuDds,4924
2961
- WPyrogram-2.0.141.dist-info/NOTICE,sha256=QL3iJdeVh_ZqRZZchyruQic5bYUWdx3yl0OkSUC2PQc,774
2962
- WPyrogram-2.0.141.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
2963
- WPyrogram-2.0.141.dist-info/top_level.txt,sha256=vS2-tKX7dJ1uKjistE5CoOVbv4yqglA95SK0KFEDwl0,9
2964
- WPyrogram-2.0.141.dist-info/RECORD,,
2958
+ WPyrogram-2.0.142.dist-info/COPYING,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
2959
+ WPyrogram-2.0.142.dist-info/COPYING.lesser,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
2960
+ WPyrogram-2.0.142.dist-info/METADATA,sha256=FeimpQI_Lg_8gtjozROnIZEWvO7Y7ZFmhZTbGzI7wxw,4924
2961
+ WPyrogram-2.0.142.dist-info/NOTICE,sha256=QL3iJdeVh_ZqRZZchyruQic5bYUWdx3yl0OkSUC2PQc,774
2962
+ WPyrogram-2.0.142.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
2963
+ WPyrogram-2.0.142.dist-info/top_level.txt,sha256=vS2-tKX7dJ1uKjistE5CoOVbv4yqglA95SK0KFEDwl0,9
2964
+ WPyrogram-2.0.142.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.141"
19
+ __version__ = "2.0.142"
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
 
@@ -75,6 +75,18 @@ class GetForumTopicsByID:
75
75
  chats = {c.id: c for c in getattr(r, "chats", [])}
76
76
  messages = {m.id: m for m in getattr(r, "messages", [])}
77
77
 
78
+ for message in messages:
79
+ if isinstance(message, raw.types.MessageEmpty):
80
+ continue
81
+
82
+ messages[message.id] = await types.Message._parse(
83
+ client=self,
84
+ message=message,
85
+ users=users,
86
+ chats=chats,
87
+ replies=0
88
+ )
89
+
78
90
  for current in getattr(r, "topics", []):
79
91
  topics.append(types.ForumTopic._parse(
80
92
  self,
@@ -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: