WPyrogram 2.0.123__py3-none-any.whl → 2.0.126__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.
Files changed (69) hide show
  1. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/METADATA +9 -8
  2. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/RECORD +69 -21
  3. pyrogram/__init__.py +1 -1
  4. pyrogram/enums/__init__.py +16 -14
  5. pyrogram/enums/chat_event_action.py +10 -1
  6. pyrogram/enums/message_media_type.py +3 -0
  7. pyrogram/enums/message_service_type.py +18 -0
  8. pyrogram/enums/stories_privacy_rules.py +36 -0
  9. pyrogram/handlers/__init__.py +2 -2
  10. pyrogram/handlers/story_handler.py +49 -0
  11. pyrogram/methods/bots/send_game.py +9 -9
  12. pyrogram/methods/bots/send_inline_bot_result.py +10 -11
  13. pyrogram/methods/decorators/__init__.py +4 -2
  14. pyrogram/methods/decorators/on_story.py +61 -0
  15. pyrogram/methods/stories/apply_boost.py +53 -0
  16. pyrogram/methods/stories/can_send_story.py +54 -0
  17. pyrogram/methods/stories/copy_story.py +117 -0
  18. pyrogram/methods/stories/delete_stories.py +67 -0
  19. pyrogram/methods/stories/edit_story.py +259 -0
  20. pyrogram/methods/stories/export_story_link.py +61 -0
  21. pyrogram/methods/stories/forward_story.py +38 -0
  22. pyrogram/methods/stories/get_all_stories.py +67 -0
  23. pyrogram/methods/stories/get_peer_stories.py +69 -0
  24. pyrogram/methods/stories/get_pinned_stories.py +91 -0
  25. pyrogram/methods/stories/get_stories.py +83 -0
  26. pyrogram/methods/stories/get_stories_archive.py +92 -0
  27. pyrogram/methods/stories/hide_stories.py +57 -0
  28. pyrogram/methods/stories/increment_story_views.py +60 -0
  29. pyrogram/methods/stories/pin_stories.py +69 -0
  30. pyrogram/methods/stories/read_stories.py +60 -0
  31. pyrogram/methods/stories/send_story.py +4 -8
  32. pyrogram/types/input_message_content/__init__.py +4 -2
  33. pyrogram/types/input_message_content/input_reply_to_message.py +52 -0
  34. pyrogram/types/input_message_content/input_reply_to_story.py +48 -0
  35. pyrogram/types/messages_and_media/__init__.py +19 -4
  36. pyrogram/types/messages_and_media/auto_name.py +27 -0
  37. pyrogram/types/messages_and_media/chat_action.py +72 -0
  38. pyrogram/types/messages_and_media/chat_event_action.py +127 -0
  39. pyrogram/types/messages_and_media/chat_member_status.py +43 -0
  40. pyrogram/types/messages_and_media/chat_members_filter.py +42 -0
  41. pyrogram/types/messages_and_media/chat_type.py +40 -0
  42. pyrogram/types/messages_and_media/forum_topic.py +150 -0
  43. pyrogram/types/messages_and_media/forum_topic_closed.py +29 -0
  44. pyrogram/types/messages_and_media/forum_topic_created.py +62 -0
  45. pyrogram/types/messages_and_media/forum_topic_edited.py +56 -0
  46. pyrogram/types/messages_and_media/forum_topic_reopened.py +29 -0
  47. pyrogram/types/messages_and_media/general_forum_topic_hidden.py +29 -0
  48. pyrogram/types/messages_and_media/general_forum_topic_unhidden.py +29 -0
  49. pyrogram/types/messages_and_media/message.py +299 -179
  50. pyrogram/types/messages_and_media/message_entity_type.py +84 -0
  51. pyrogram/types/messages_and_media/message_media_type.py +70 -0
  52. pyrogram/types/messages_and_media/message_service_type.py +73 -0
  53. pyrogram/types/messages_and_media/message_story.py +59 -0
  54. pyrogram/types/messages_and_media/messages_filter.py +75 -0
  55. pyrogram/types/messages_and_media/next_code_type.py +39 -0
  56. pyrogram/types/messages_and_media/parse_mode.py +37 -0
  57. pyrogram/types/messages_and_media/poll_type.py +31 -0
  58. pyrogram/types/messages_and_media/sent_code_type.py +45 -0
  59. pyrogram/types/messages_and_media/story.py +1773 -0
  60. pyrogram/types/messages_and_media/story_deleted.py +97 -0
  61. pyrogram/types/messages_and_media/story_skipped.py +116 -0
  62. pyrogram/types/messages_and_media/story_views.py +75 -0
  63. pyrogram/types/messages_and_media/user_status.py +43 -0
  64. pyrogram/utils.py +60 -53
  65. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/COPYING +0 -0
  66. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/COPYING.lesser +0 -0
  67. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/NOTICE +0 -0
  68. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/WHEEL +0 -0
  69. {WPyrogram-2.0.123.dist-info → WPyrogram-2.0.126.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: WPyrogram
3
- Version: 2.0.123
4
- Summary: Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots - Amano's experimental fork
3
+ Version: 2.0.126
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
- Download-URL: https://github.com/AmanoTeam/pyrogram
6
+ Download-URL: https://github.com/ALiwoto/WPyrogram
7
7
  Author: Dan
8
8
  Author-email: dan@pyrogram.org
9
9
  License: LGPLv3
@@ -111,14 +111,15 @@ If you'd like to support Pyrogram, you can consider:
111
111
  ### Installing
112
112
 
113
113
  #### From git (recommended)
114
+
115
+ > NOTE: in order to use WPyrogram, please uninstall pyrogram first.
116
+
114
117
  ```sh
115
- pip install 'pyrogram @ git+https://github.com/AmanoTeam/pyrogram.git@v2.0.106+amn7'
116
- ```
117
- #### From tag tarball
118
- ```sh
119
- pip install 'pyrogram @ https://github.com/AmanoTeam/pyrogram/archive/refs/tags/v2.0.106+amn7.tar.gz'
118
+ pip uninstall pyrogram
119
+ pip install 'wpyrogram'
120
120
  ```
121
121
 
122
+
122
123
  ### Resources
123
124
 
124
125
  - Check out the docs at https://docs.pyrogram.org to learn more about Pyrogram, get started right
@@ -1,4 +1,4 @@
1
- pyrogram/__init__.py,sha256=85K8_B0_t4AjRskRb1qoVfupIB1Z3MEfDP7eg6iq6XM,1400
1
+ pyrogram/__init__.py,sha256=gwXxLBgd8YYkInoYkyxARaxbkPrPh-AIO3S19WMvXbM,1400
2
2
  pyrogram/client.py,sha256=ZGIswWl-_EacPx8pB3BexUgaHhEJ85qAYlM1GqBaops,46518
3
3
  pyrogram/dispatcher.py,sha256=vOYzolziyRNu8Tc1ja5pFotBtp_EPmAYAMZb24HV0ls,10191
4
4
  pyrogram/emoji.py,sha256=ixb3OXR1XpLf3BQpw8kWIpmbQRowRIaFedjdnuzljac,208021
@@ -7,7 +7,7 @@ pyrogram/filters.py,sha256=Y0jwQ_QIHb8DATVIDS-4u_NxTMM05L6331MbfLk9Ee4,25022
7
7
  pyrogram/mime_types.py,sha256=JbYF6B-JrxZQNga8dPz2C8Dwp8-2pOrE1uv3KIBbjA0,61915
8
8
  pyrogram/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  pyrogram/sync.py,sha256=cxKmLz9NAJPX2N2n2CogTLXyNo-dWgf6etBRXnqq1XA,3739
10
- pyrogram/utils.py,sha256=dB5VQzEMhS2zxdeuAxPEXBblswGnPn7KFgwuQY_KDIk,12042
10
+ pyrogram/utils.py,sha256=aY8OBfku_rh34cNl4XzlhI4airn3V3rhG-qJL5IJuFE,12891
11
11
  pyrogram/connection/__init__.py,sha256=q7KiWEV6VNDQGoj5s13GPyhRRlafXVPvX1h1VpAsVf8,854
12
12
  pyrogram/connection/connection.py,sha256=GGyBx0sT2R4wal7yBSkeJvnoohkB0XYySdVhvsfiM_4,2542
13
13
  pyrogram/connection/transport/__init__.py,sha256=nRpFdumPinBtuLOZkR8hH_vXlN7ChzW1oyJ6na4a8qw,838
@@ -23,21 +23,22 @@ pyrogram/crypto/aes.py,sha256=AS5me5W2ksoJ1i13JBcoMaO4MlpVxt04y5PCZRrT8W4,4013
23
23
  pyrogram/crypto/mtproto.py,sha256=qwoXwETZzjzFDA-mRvdYL2kel0IToELLOdfE9Lhr0Gk,4018
24
24
  pyrogram/crypto/prime.py,sha256=hZe9xlM_nfOonL53emLn9zjmT79SHC5yFgDElZ-II40,2446
25
25
  pyrogram/crypto/rsa.py,sha256=5A89QWIwKz1JB-Ng3N7r_ONJSzXL-t8lWKGy585W06I,13437
26
- pyrogram/enums/__init__.py,sha256=Mz2zBULs-Zo0RzntqDSj0p1JX2kmbG-tyOnvFwS7JlA,1736
26
+ pyrogram/enums/__init__.py,sha256=n-0pSH4V1IMzq6Kav9S3y1Tr2DcgKVrKQb73MDsJ9x0,1804
27
27
  pyrogram/enums/auto_name.py,sha256=YEFxmS8URqR1SLHqtSwDry_t48158GS-nHq7uMtwITw,1002
28
28
  pyrogram/enums/chat_action.py,sha256=htJ7CyLxKF5g8kmuSQlZw1G_xzHJ0G7ipIrte5UpTLw,2307
29
- pyrogram/enums/chat_event_action.py,sha256=lhfSzB8PNrC6KKbM1GcAPQJ1LteBwnG_gspstKVI5Hk,4203
29
+ pyrogram/enums/chat_event_action.py,sha256=dkhhC2fBmRBzuuCmAHG5hK7AjytixFCocxa9tqWdq6w,4519
30
30
  pyrogram/enums/chat_member_status.py,sha256=R52wBlniGyVz1STL_xbY8Q8qNRdiUuf926MEKpGb2ww,1265
31
31
  pyrogram/enums/chat_members_filter.py,sha256=elc_gNvVeE0jY0O8ecoJPJ9sX7jXpbvnLTGDRNu1_l0,1446
32
32
  pyrogram/enums/chat_type.py,sha256=vf-DMg89K5hjOwuJbOHp66dM3whu_ZdMDiuWBA2z16g,1238
33
33
  pyrogram/enums/message_entity_type.py,sha256=tsAs7zQ_QuAQ2eCV5L9oQmXltJ3VpLUn5suZVJ_RbLs,2464
34
- pyrogram/enums/message_media_type.py,sha256=EgSJKsJm4SYjMOx-ce-m3EWMNVCrBPZkrSGmJqDPPr4,1599
35
- pyrogram/enums/message_service_type.py,sha256=BEbnNVWIP6RB8462OepoYXoYbvG91okNdqwjdPTiVaQ,1900
34
+ pyrogram/enums/message_media_type.py,sha256=42ovlWgM-RI5twZcLn97tAyZUMFsSF2cn2_vo4kvgg8,1636
35
+ pyrogram/enums/message_service_type.py,sha256=Pgm4tmkEgzkFKs-uq-G1-Cgh1IQPAR8Z4KhHKbO7zEM,2379
36
36
  pyrogram/enums/messages_filter.py,sha256=zuRmFYB1D-3-THlsOmVm6G41iBZkggjCg6vV-ocqTYI,2406
37
37
  pyrogram/enums/next_code_type.py,sha256=GMofmZCvqJxjn_2bXWjQ7T06AiI584UlWlfZYtBnVS0,1521
38
38
  pyrogram/enums/parse_mode.py,sha256=9xKPMEZf1hIYsCHWWcemCFyo3U5xnaQ05pYiaxvXezk,1188
39
39
  pyrogram/enums/poll_type.py,sha256=C2MDTqWrRBT24qnkuosxIA5E8vDeGYDpAPep7o6HIgE,1047
40
40
  pyrogram/enums/sent_code_type.py,sha256=LHRDeJ3YTdi0v_-12y5RA3Yn7t9BMKal2cz7-EQ1txg,1723
41
+ pyrogram/enums/stories_privacy_rules.py,sha256=amhc_17RKy1V04FQe8jLHX929YYXbdwVqCUKbPVg3WI,1210
41
42
  pyrogram/enums/user_status.py,sha256=0WEpJJmjfGsJ3CVEhItO3Zc1VP9CBjgZBpxWUOzoFFg,1299
42
43
  pyrogram/errors/__init__.py,sha256=Td5_TRqn2Ht6R3ZTxrLJaL_HoaugITxNCsiYEfueqCw,2605
43
44
  pyrogram/errors/rpc_error.py,sha256=18YbiYLQ-wKBZJ389SfPpl0pwQMHn4Xzh0leuZ-vuNU,3315
@@ -51,7 +52,7 @@ pyrogram/errors/exceptions/not_acceptable_406.py,sha256=Ths6smBw-CSH5vyH6f6uF9MF
51
52
  pyrogram/errors/exceptions/see_other_303.py,sha256=_-P2lSLpLky-e5L17DLWneEponf5uw2sUGY2FabD-KI,1952
52
53
  pyrogram/errors/exceptions/service_unavailable_503.py,sha256=wF0xKXuATBot0I1P7Lr58nYkXkG38Qx3PtwlCCLkB8U,1535
53
54
  pyrogram/errors/exceptions/unauthorized_401.py,sha256=-b6fglrqn1EZ_lQP56dcuK7pfhH5wPeT9nh8cyMOjZQ,2672
54
- pyrogram/handlers/__init__.py,sha256=jQNcqCXGbOQMPepsry7HwiA1BQB3YvTjgWXH77kdmsg,1529
55
+ pyrogram/handlers/__init__.py,sha256=uMGKQQrvscrP_kDI-42RO74yLEWb3fdCbQir8U9g9-Q,1514
55
56
  pyrogram/handlers/callback_query_handler.py,sha256=SsGiLY69WAXiVs5EKJ_Q0KqQjHOVp2Cg2Wok3g0tsT0,4255
56
57
  pyrogram/handlers/chat_join_request_handler.py,sha256=8jWNUBgxJE54_WAHBHp_HpglHNrjJEZsNKfudsBeo0s,2011
57
58
  pyrogram/handlers/chat_member_updated_handler.py,sha256=8ceqNAlH7KBU5ukkfV1v44uvCZzA_reiKDUIQ8jsH2s,2046
@@ -65,6 +66,7 @@ pyrogram/handlers/inline_query_handler.py,sha256=uQ5CIEBgvWaizCnMaah08T576OP0K54
65
66
  pyrogram/handlers/message_handler.py,sha256=qznPp-JGEr4wD6p5ZbdRwvfmEmK0tmS4UQGSn1ujVVY,3676
66
67
  pyrogram/handlers/poll_handler.py,sha256=IngTr6CYaDTzc6ign2F0noaoGcN7ddlncpjgeKm1UyQ,1914
67
68
  pyrogram/handlers/raw_update_handler.py,sha256=9Uh0oVyDm4AgQ39Y87JaebeL5V6HM1eE6svW6HYY114,2942
69
+ pyrogram/handlers/story_handler.py,sha256=CuRrErJjqPH9SOS29MHxJzE_mNJ0Aqti9SQ9isa92L0,1916
68
70
  pyrogram/handlers/user_status_handler.py,sha256=NcrvIuvaE8cwccG0cgSjGtN12IVLbDi1OZqDmiuht8k,1989
69
71
  pyrogram/helpers/__init__.py,sha256=m_M6ou18C90xwO3l1gstKqLHVIQCZYGCdikR4uAFOfQ,818
70
72
  pyrogram/helpers/helpers.py,sha256=ZWe6V_SOMmZZBeq_r7hBmweGcKCUwPg4W6aUthquAcY,2042
@@ -100,8 +102,8 @@ pyrogram/methods/bots/get_chat_menu_button.py,sha256=cOek_NoNG_LOs1tUaqc2UqXh3el
100
102
  pyrogram/methods/bots/get_game_high_scores.py,sha256=ais2gK7YfKhwDo_WhyOdi9WYj4kXmSPq8U9KKnMV3ps,2798
101
103
  pyrogram/methods/bots/get_inline_bot_results.py,sha256=bnV9ayI6t3w7bZf2GqVuwo-sS6KvjsNmcCK81C0WNv8,3365
102
104
  pyrogram/methods/bots/request_callback_answer.py,sha256=JK1hfk4wuLkyAotRbRCr8aeMlNstSwGAXAaDkKB21WY,2847
103
- pyrogram/methods/bots/send_game.py,sha256=eO1OYMELi9ibRNIuaDspvYLauz5GV0m6AV5QVBuTTnY,4178
104
- pyrogram/methods/bots/send_inline_bot_result.py,sha256=s7Ym_evFL166QA4s0kzt7nJFctEIwLv2spmo-lzW5wI,3067
105
+ pyrogram/methods/bots/send_game.py,sha256=WDGchGf8uv3gctETv2wdBeNKe-b-bm2B-Xay6W5D8V0,4229
106
+ pyrogram/methods/bots/send_inline_bot_result.py,sha256=CuPrepGBd53ihU2SbTUEHLMarGTuWvgiw2uAAkbYoIg,3099
105
107
  pyrogram/methods/bots/set_bot_commands.py,sha256=LbMSB3RLHNRPcmX6Azakt289JRyx5Y82ksSde8t9gj4,2710
106
108
  pyrogram/methods/bots/set_bot_default_privileges.py,sha256=KL2oX1O8f9Lsez1iSaxJKK2BEvw0tNoW8VKh0UUunW4,3186
107
109
  pyrogram/methods/bots/set_chat_menu_button.py,sha256=jNzIy93GcYPqyg9FhvvN-NeBznstgDmQIJU-OVfSIi8,2048
@@ -152,7 +154,7 @@ pyrogram/methods/contacts/delete_contacts.py,sha256=o16G0xjhW0s9U23OOVf95UojcCDW
152
154
  pyrogram/methods/contacts/get_contacts.py,sha256=x51h5r61JtOJvg_7kbdxCQ3vfJj0BHG7TnS3l-lp_Tk,1605
153
155
  pyrogram/methods/contacts/get_contacts_count.py,sha256=p2xPnjRSTQKwU7cLYDr4V_owhR7uaiFnfM5sdBHfHfE,1422
154
156
  pyrogram/methods/contacts/import_contacts.py,sha256=SavyyDMF_B3-2tlzjXu6S7V7wKSNuoBAYZcVh5DReJY,1934
155
- pyrogram/methods/decorators/__init__.py,sha256=zfA3xke1L1zDcpAJhxU0svgb6RriObW9nuPCbPgOrmA,1624
157
+ pyrogram/methods/decorators/__init__.py,sha256=YbNRaioAEh2P0zFqWeUnZP95mwS3Ov9m0WtxGUysubY,1666
156
158
  pyrogram/methods/decorators/on_callback_query.py,sha256=pfluCK6sUjj19rjYEeCJgi2-lAVW1Jo6fE5QVttoJ_A,2181
157
159
  pyrogram/methods/decorators/on_chat_join_request.py,sha256=xj3_BATr2J_2GCZ0fureS-LhaeTOJPDi150FHkfmw4M,2169
158
160
  pyrogram/methods/decorators/on_chat_member_updated.py,sha256=eKHEywNRh5uMeMPkgQfK4Bp5EgCNd-tUNZPC_k3f6CQ,2190
@@ -164,6 +166,7 @@ pyrogram/methods/decorators/on_inline_query.py,sha256=KlMO9TKBIkbtr-Cxuxpm6evwQ5
164
166
  pyrogram/methods/decorators/on_message.py,sha256=ja05g_qjFSUsF1UuJBOSA9XNEnnn06AWLk8htNNaPck,2138
165
167
  pyrogram/methods/decorators/on_poll.py,sha256=oSnvFaHyw6utJhon0RAADNbOSM26WKCb7sdW4tBTDUk,2120
166
168
  pyrogram/methods/decorators/on_raw_update.py,sha256=A8X4AMmNO3AMQPjfvibslAnVxXPBjcd1Yo7qlUaIaTY,1818
169
+ pyrogram/methods/decorators/on_story.py,sha256=Hf1lEPUto2kDj0bUl1df2TsmDQ9HccabFfhlFbQ5iiY,2125
167
170
  pyrogram/methods/decorators/on_user_status.py,sha256=b2iFqzaaHVfslnRaNdV0hHfoZI_EzwnAAJtazGetPTI,2154
168
171
  pyrogram/methods/invite_links/__init__.py,sha256=jJAxU6EIgqJ8_NjLiI5fHJdczFed98Y-5cNJKfG8jGs,2435
169
172
  pyrogram/methods/invite_links/approve_all_chat_join_requests.py,sha256=Y8ls46X7Hx0mSAbhQEmTIZaqSeUIT0_4etVw2rmO0DQ,1894
@@ -240,7 +243,23 @@ pyrogram/methods/password/change_cloud_password.py,sha256=UYwjT1MsALY49cixsm-XY-
240
243
  pyrogram/methods/password/enable_cloud_password.py,sha256=W5tVXfwoGCgfvBM7EDlx976Hazl21lVKjbpK8Rc-iFQ,3006
241
244
  pyrogram/methods/password/remove_cloud_password.py,sha256=JidQpLomzEs6teTcF3zNcthYrapIvCfhBfgaBptcyyM,2143
242
245
  pyrogram/methods/stories/__init__.py,sha256=d79VjlM9pYnbwQHrNcnEC7I0yEMLHReuz65a0tF4D8Y,76
243
- pyrogram/methods/stories/send_story.py,sha256=dH2DZ-4j1YZMx86GAOUA8FSq1Vt12-iRsqg8WjV421E,13955
246
+ pyrogram/methods/stories/apply_boost.py,sha256=FKzAzNsNgjTbWd0iZIzDVJMLtvLvcOJgYelaoVoFmJY,1628
247
+ pyrogram/methods/stories/can_send_story.py,sha256=G_995lg_L_P8Hcl4D0BQlBp2GDsmyuvyVMjVTbM5rGQ,1694
248
+ pyrogram/methods/stories/copy_story.py,sha256=KtCw7yCzRuC3dvEhtCkkZeCXesfbNOgfgdNlYSqbU64,4902
249
+ pyrogram/methods/stories/delete_stories.py,sha256=r6TK_7r4h1w3eJWe9b37NMboP7xGdytkx037EXmapic,2343
250
+ pyrogram/methods/stories/edit_story.py,sha256=XCUDKuKZSkcuMpp0ha_Y0YqTrkekf5gr7RMWO9bFKXQ,12206
251
+ pyrogram/methods/stories/export_story_link.py,sha256=TZmH3Lz2VFka6-3zZjTEur0dgizrnH9iuuBiPCLuj5w,2080
252
+ pyrogram/methods/stories/forward_story.py,sha256=DJZ4Z8iCSFbiM-wBbb3d1qvPfhR-oeFxjsq1pnpmlJY,1343
253
+ pyrogram/methods/stories/get_all_stories.py,sha256=k7OYh7z4oAYYJh27x0s2iP1aPnyHlHKbpQDs1gRlJSk,2207
254
+ pyrogram/methods/stories/get_peer_stories.py,sha256=BcTZkLvaDM0GJK46HZBaYAi1BUVXa7tyk0d9FdZnCK4,2431
255
+ pyrogram/methods/stories/get_pinned_stories.py,sha256=uu3wn9UZh8Zap01B-s9BA2BaJ5wTg0jfUiASNH6RcpE,2939
256
+ pyrogram/methods/stories/get_stories.py,sha256=HgQqjg4B8s71fqA9Gg1_XW85qSVd6ATau4kDTv4Z-ts,2902
257
+ pyrogram/methods/stories/get_stories_archive.py,sha256=wRKLjR-ZfIIcw7qae5mtgXP_wQNQSqe0Mtp1-_Y-LSM,3047
258
+ pyrogram/methods/stories/hide_stories.py,sha256=a7QiKrEf3jA14vLOD9U6E_yda0mmx-qDDDOejQH-MJk,1918
259
+ pyrogram/methods/stories/increment_story_views.py,sha256=wXm-QSo1MXqJ81rc7lf3Q8TV1Zlu5rtRoCeQGn_qbow,2023
260
+ pyrogram/methods/stories/pin_stories.py,sha256=BnKyCrzP9J5wBG_lSb03VuyJ8OmqMB3RWO4jztpPUZs,2303
261
+ pyrogram/methods/stories/read_stories.py,sha256=W423h-dKIKj6cGRCgtQUqCJC_A6UYeUiukWwYl7p-fc,2046
262
+ pyrogram/methods/stories/send_story.py,sha256=XzLCuZQoxfOhL-L2YzrWh-tvg0Lux8E3O9FtLxIX0JU,13620
244
263
  pyrogram/methods/users/__init__.py,sha256=vQ6XbYSvPnfYMWAT5YH6bZNOXBxiyp-NW9sTeI16Lpo,1659
245
264
  pyrogram/methods/users/block_user.py,sha256=aT-FyS-FaUrzQjeG6QHNhrMiJoSloCVPHyBgrwoA-LI,1875
246
265
  pyrogram/methods/users/delete_profile_photos.py,sha256=0-YdzEv3DTWZcmb9NWQ4hCTFowoczZK2p8EQJTYzk_8,2237
@@ -2611,27 +2630,56 @@ pyrogram/types/input_media/input_media_document.py,sha256=3yd4W36Gl_rht6AGDKfmgq
2611
2630
  pyrogram/types/input_media/input_media_photo.py,sha256=x2vTGd0GU5APLNTHd33AOVIWkxCOU7LK6eVruVbQdpE,2685
2612
2631
  pyrogram/types/input_media/input_media_video.py,sha256=5_ykPUCRZKWGZ4RpO6VOQrZyTGPJ_qvPM4qYS_k5FNM,3620
2613
2632
  pyrogram/types/input_media/input_phone_contact.py,sha256=2bbSIhMjEXWgcfeOfz53mIPwqqP9f1zWE1zRfbph9Yo,1737
2614
- pyrogram/types/input_message_content/__init__.py,sha256=vmwDEVdpZp1nvp67yzc8_P9NGT0P_FLWiXtIENe9-ZI,1006
2633
+ pyrogram/types/input_message_content/__init__.py,sha256=CI0Bu_Awa8FZc69wkoaAXO4EdzkPnv1AJm3rdurvjdg,1157
2615
2634
  pyrogram/types/input_message_content/input_message_content.py,sha256=rtkinfhcHQdo51AWuER5uuLf8srWhOjszGU8gBJlLTg,1413
2635
+ pyrogram/types/input_message_content/input_reply_to_message.py,sha256=TiHHkHfgURP_21b-1YD4SjV8tSzqhQmxYGMg-A8OCXc,1904
2636
+ pyrogram/types/input_message_content/input_reply_to_story.py,sha256=TfJfk-bOBvmvu1vzxLO5QHhxT2qHeS-YZP7cIu3yJ7M,1528
2616
2637
  pyrogram/types/input_message_content/input_text_message_content.py,sha256=OsTd6vFLIAWKEfIKqZtj4cYgtgtD9W4hMhUSj1BZ2eM,2638
2617
- pyrogram/types/messages_and_media/__init__.py,sha256=X1O8y8lbKEs_EFVnctno2mR60Ccw0ByLS348ykPfgZ0,1836
2638
+ pyrogram/types/messages_and_media/__init__.py,sha256=7O9rD0GSekytR5q9lJWmo68V8H3BXmXX9eU8iDILFO4,2602
2618
2639
  pyrogram/types/messages_and_media/animation.py,sha256=oV4kiR1xEF6NR789pMwhbwzpWcEEnkHZzgybEocQT1w,4044
2619
2640
  pyrogram/types/messages_and_media/audio.py,sha256=hzjwteB8tdVG2zUtVEpTMgxPgd1bo8MO7jqAVc53Y_c,4069
2641
+ pyrogram/types/messages_and_media/auto_name.py,sha256=YEFxmS8URqR1SLHqtSwDry_t48158GS-nHq7uMtwITw,1002
2642
+ pyrogram/types/messages_and_media/chat_action.py,sha256=htJ7CyLxKF5g8kmuSQlZw1G_xzHJ0G7ipIrte5UpTLw,2307
2643
+ pyrogram/types/messages_and_media/chat_event_action.py,sha256=lhfSzB8PNrC6KKbM1GcAPQJ1LteBwnG_gspstKVI5Hk,4203
2644
+ pyrogram/types/messages_and_media/chat_member_status.py,sha256=R52wBlniGyVz1STL_xbY8Q8qNRdiUuf926MEKpGb2ww,1265
2645
+ pyrogram/types/messages_and_media/chat_members_filter.py,sha256=elc_gNvVeE0jY0O8ecoJPJ9sX7jXpbvnLTGDRNu1_l0,1446
2646
+ pyrogram/types/messages_and_media/chat_type.py,sha256=vf-DMg89K5hjOwuJbOHp66dM3whu_ZdMDiuWBA2z16g,1238
2620
2647
  pyrogram/types/messages_and_media/contact.py,sha256=aLWR0NrRva5XBOll2j4OHV4MC4FP00njo50QJgppQkc,2207
2621
2648
  pyrogram/types/messages_and_media/dice.py,sha256=QizhLYoiobEO-7OjyfHxpTlySAVF6fAxffgtcALMzYI,1587
2622
2649
  pyrogram/types/messages_and_media/document.py,sha256=qwQcClccgDPasmob2CzGdmalV7gfMmwOBdGuV4TWMus,3409
2650
+ pyrogram/types/messages_and_media/forum_topic.py,sha256=Z0f0rOvRyQ6Zbce4xPhnRNGV0C9ajMjnXpLcKHelUqw,4989
2651
+ pyrogram/types/messages_and_media/forum_topic_closed.py,sha256=1wkDmL5rmxUjO9qc6y8LQ8yUvvMGsN6tVsrZo1RsHcY,1043
2652
+ pyrogram/types/messages_and_media/forum_topic_created.py,sha256=ScLWvwrH-jb6HUe5BciqNvqZfnOMwYpjRnnR5zRZ1YY,1996
2653
+ pyrogram/types/messages_and_media/forum_topic_edited.py,sha256=EhNKH7_7syPrw1RbWhTcOP4oIUNqToYjhocnasSTB_A,1862
2654
+ pyrogram/types/messages_and_media/forum_topic_reopened.py,sha256=Wy_6gNW-PzIbde4ez-6shs7tKO8gyOhG2OxmGHCtn38,1047
2623
2655
  pyrogram/types/messages_and_media/game.py,sha256=Bg4RQcepQKHAsNJOU_gWqcKUiCWAyohTAYWRvJ7HSmM,3044
2656
+ pyrogram/types/messages_and_media/general_forum_topic_hidden.py,sha256=G-IijqiAjcLc6rEJ_3raM3FrhKv7GrR5-bl5fzKFDdE,1047
2657
+ pyrogram/types/messages_and_media/general_forum_topic_unhidden.py,sha256=awSV2suiag3mNt5v54EMhT-YnSISDJDCqbwHPd3gEao,1051
2624
2658
  pyrogram/types/messages_and_media/location.py,sha256=IYwxV-4iv1sPQiil3wimLhf6mYl-pwfb5d_MzCc_R-Y,1660
2625
- pyrogram/types/messages_and_media/message.py,sha256=Kb4_eT2Uc4D-jjnt_niVweWkI3clbwqAaHxBFVIwyCM,149942
2659
+ pyrogram/types/messages_and_media/message.py,sha256=SzNInVGHGtOGVkemyzrOqSuCfMtrUjG_wcK52cKf7sA,157724
2626
2660
  pyrogram/types/messages_and_media/message_entity.py,sha256=nMhl8n690ItTUTd7RjGrnSzWwKCjnFUpMEq1sDcXaAQ,4352
2661
+ pyrogram/types/messages_and_media/message_entity_type.py,sha256=tsAs7zQ_QuAQ2eCV5L9oQmXltJ3VpLUn5suZVJ_RbLs,2464
2662
+ pyrogram/types/messages_and_media/message_media_type.py,sha256=EgSJKsJm4SYjMOx-ce-m3EWMNVCrBPZkrSGmJqDPPr4,1599
2627
2663
  pyrogram/types/messages_and_media/message_reactions.py,sha256=ckBrBlFujQdiKCWqV9uUZ2kInU4jMz7AztK67uYmN5A,1800
2664
+ pyrogram/types/messages_and_media/message_service_type.py,sha256=BEbnNVWIP6RB8462OepoYXoYbvG91okNdqwjdPTiVaQ,1900
2665
+ pyrogram/types/messages_and_media/message_story.py,sha256=vEbg9IV3alGghXoVOGXqqFdE39_WX1vGsWlpX2C73YU,1890
2666
+ pyrogram/types/messages_and_media/messages_filter.py,sha256=zuRmFYB1D-3-THlsOmVm6G41iBZkggjCg6vV-ocqTYI,2406
2667
+ pyrogram/types/messages_and_media/next_code_type.py,sha256=GMofmZCvqJxjn_2bXWjQ7T06AiI584UlWlfZYtBnVS0,1521
2668
+ pyrogram/types/messages_and_media/parse_mode.py,sha256=9xKPMEZf1hIYsCHWWcemCFyo3U5xnaQ05pYiaxvXezk,1188
2628
2669
  pyrogram/types/messages_and_media/photo.py,sha256=NcQiePNa7fDT4Kvhpxtz9W-lNMfP-d0zpAvXXqWTork,4309
2629
2670
  pyrogram/types/messages_and_media/poll.py,sha256=SOfnz8mX7HBtdkbDWrnZoKy48YzwA38iCnXc2uZ6txw,8016
2630
2671
  pyrogram/types/messages_and_media/poll_option.py,sha256=Cc5q8FMd6sq5u4n2kA5ThWt640qGJGBdoYJtSHlj9lM,1532
2672
+ pyrogram/types/messages_and_media/poll_type.py,sha256=C2MDTqWrRBT24qnkuosxIA5E8vDeGYDpAPep7o6HIgE,1047
2631
2673
  pyrogram/types/messages_and_media/reaction.py,sha256=H9KwyjEYyYCZQV8VyP3M4pW9JiU7an5JkoeaOq7bUfI,2617
2674
+ pyrogram/types/messages_and_media/sent_code_type.py,sha256=LHRDeJ3YTdi0v_-12y5RA3Yn7t9BMKal2cz7-EQ1txg,1723
2632
2675
  pyrogram/types/messages_and_media/sticker.py,sha256=niXemA51ocYI40fZQ6q_GlAyzsZIcuX787JP_F4Gf9I,6909
2676
+ pyrogram/types/messages_and_media/story.py,sha256=eK9UPIPRTmw_v_8f09pA3I3B-BEXT8dLa4pTL-LlXuQ,69799
2677
+ pyrogram/types/messages_and_media/story_deleted.py,sha256=H63jL1gSvyjGUwzTbYCn2glWXhmXbBu-ds9sHv_wyUc,3247
2678
+ pyrogram/types/messages_and_media/story_skipped.py,sha256=7_NaXX_7vzVsnkwUqZxAoC59XaqIfPwohzh5fGEa-Ms,3974
2679
+ pyrogram/types/messages_and_media/story_views.py,sha256=yieH6HNdqcx915pS0-X4zpypB9ziXsDPoDu9E3hkdxM,2677
2633
2680
  pyrogram/types/messages_and_media/stripped_thumbnail.py,sha256=9GpKuySE66njHsJ9YRapMLyKxHKy9_p1lBfEHNDV16c,1431
2634
2681
  pyrogram/types/messages_and_media/thumbnail.py,sha256=WbeaCJoGxe84U9XGRKksATCr-BFhDor50pdQL8mdprs,3755
2682
+ pyrogram/types/messages_and_media/user_status.py,sha256=0WEpJJmjfGsJ3CVEhItO3Zc1VP9CBjgZBpxWUOzoFFg,1299
2635
2683
  pyrogram/types/messages_and_media/venue.py,sha256=e2TmAVi2wCsYkD5hiH6HgZmQyU_QvLtGl5456BKN8ls,2291
2636
2684
  pyrogram/types/messages_and_media/video.py,sha256=vzVvdPJqYOy33F_altJ8n4IteBvadSj3ZUxJTNXfbdk,4389
2637
2685
  pyrogram/types/messages_and_media/video_note.py,sha256=mF0hWg-JByhuiaPZmsCm8YGX9cU3u7j2GR_ZgZKyO3o,3601
@@ -2662,10 +2710,10 @@ pyrogram/types/user_and_chats/video_chat_ended.py,sha256=J5xTIAMSGDz8_z-EGrKwkoJ
2662
2710
  pyrogram/types/user_and_chats/video_chat_members_invited.py,sha256=9QhonApJd1XjOeJu9fqx2_u6nIOTZhfXZw_tX9XXxd8,1610
2663
2711
  pyrogram/types/user_and_chats/video_chat_scheduled.py,sha256=rUvDXF8r-2MfsAZKAcaWb_UZt5VoHebPjeJXWRDHGSo,1531
2664
2712
  pyrogram/types/user_and_chats/video_chat_started.py,sha256=WOAuM_CnkRA-W_Iedx0fIHB9RJ-AsvJIiSF05HzLRdA,1043
2665
- WPyrogram-2.0.123.dist-info/COPYING,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
2666
- WPyrogram-2.0.123.dist-info/COPYING.lesser,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
2667
- WPyrogram-2.0.123.dist-info/METADATA,sha256=fbqqbLd1tTQGtOFY3WpnB7WGBRgnsZHsRz0zDoTzwNc,5029
2668
- WPyrogram-2.0.123.dist-info/NOTICE,sha256=QL3iJdeVh_ZqRZZchyruQic5bYUWdx3yl0OkSUC2PQc,774
2669
- WPyrogram-2.0.123.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
2670
- WPyrogram-2.0.123.dist-info/top_level.txt,sha256=vS2-tKX7dJ1uKjistE5CoOVbv4yqglA95SK0KFEDwl0,9
2671
- WPyrogram-2.0.123.dist-info/RECORD,,
2713
+ WPyrogram-2.0.126.dist-info/COPYING,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
2714
+ WPyrogram-2.0.126.dist-info/COPYING.lesser,sha256=pWgb-bBdsU2Gd2kwAXxketnm5W_2u8_fIeWEgojfrxs,7651
2715
+ WPyrogram-2.0.126.dist-info/METADATA,sha256=D0s4J8Eq0KMDRXwUxDRxlFmotmZDweLBvouNlR-igdI,4926
2716
+ WPyrogram-2.0.126.dist-info/NOTICE,sha256=QL3iJdeVh_ZqRZZchyruQic5bYUWdx3yl0OkSUC2PQc,774
2717
+ WPyrogram-2.0.126.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
2718
+ WPyrogram-2.0.126.dist-info/top_level.txt,sha256=vS2-tKX7dJ1uKjistE5CoOVbv4yqglA95SK0KFEDwl0,9
2719
+ WPyrogram-2.0.126.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.123"
19
+ __version__ = "2.0.126"
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
 
@@ -29,21 +29,23 @@ from .next_code_type import NextCodeType
29
29
  from .parse_mode import ParseMode
30
30
  from .poll_type import PollType
31
31
  from .sent_code_type import SentCodeType
32
+ from .stories_privacy_rules import StoriesPrivacyRules
32
33
  from .user_status import UserStatus
33
34
 
34
35
  __all__ = [
35
- 'ChatAction',
36
- 'ChatEventAction',
37
- 'ChatMemberStatus',
38
- 'ChatMembersFilter',
39
- 'ChatType',
40
- 'MessageEntityType',
41
- 'MessageMediaType',
42
- 'MessageServiceType',
43
- 'MessagesFilter',
44
- 'NextCodeType',
45
- 'ParseMode',
46
- 'PollType',
47
- 'SentCodeType',
36
+ 'ChatAction',
37
+ 'ChatEventAction',
38
+ 'ChatMemberStatus',
39
+ 'ChatMembersFilter',
40
+ 'ChatType',
41
+ 'MessageEntityType',
42
+ 'MessageMediaType',
43
+ 'MessageServiceType',
44
+ 'MessagesFilter',
45
+ 'NextCodeType',
46
+ 'ParseMode',
47
+ 'PollType',
48
+ 'SentCodeType',
49
+ 'StoriesPrivacyRules',
48
50
  'UserStatus'
49
- ]
51
+ ]
@@ -123,5 +123,14 @@ class ChatEventAction(AutoName):
123
123
  MESSAGE_UNPINNED = auto()
124
124
  "a message has been unpinned (see ``unpinned_message``)"
125
125
 
126
+ CREATED_FORUM_TOPIC = auto()
127
+ "a new forum topic has been created (see `created_forum_topic`)"
128
+
129
+ EDITED_FORUM_TOPIC = auto()
130
+ "a forum topic has been edited (see `old_forum_topic` and `new_forum_topic`)"
131
+
132
+ DELETED_FORUM_TOPIC = auto()
133
+ "a forum topic has been deleted (see `deleted_forum_topic`)"
134
+
126
135
  UNKNOWN = auto()
127
- "Unknown chat event action"
136
+ "Unknown chat event action"
@@ -68,3 +68,6 @@ class MessageMediaType(AutoName):
68
68
 
69
69
  GAME = auto()
70
70
  "Game media"
71
+
72
+ STORY = auto()
73
+ "Story media"
@@ -39,6 +39,24 @@ class MessageServiceType(AutoName):
39
39
  DELETE_CHAT_PHOTO = auto()
40
40
  "Deleted chat photo"
41
41
 
42
+ FORUM_TOPIC_CREATED = auto()
43
+ "a new forum topic created in the chat"
44
+
45
+ FORUM_TOPIC_CLOSED = auto()
46
+ "a new forum topic closed in the chat"
47
+
48
+ FORUM_TOPIC_REOPENED = auto()
49
+ "a new forum topic reopened in the chat"
50
+
51
+ FORUM_TOPIC_EDITED = auto()
52
+ "a new forum topic renamed in the chat"
53
+
54
+ GENERAL_TOPIC_HIDDEN = auto()
55
+ "a forum general topic hidden in the chat"
56
+
57
+ GENERAL_TOPIC_UNHIDDEN = auto()
58
+ "a forum general topic unhidden in the chat"
59
+
42
60
  GROUP_CHAT_CREATED = auto()
43
61
  "Group chat created"
44
62
 
@@ -0,0 +1,36 @@
1
+ # Pyrogram - Telegram MTProto API Client Library for Python
2
+ # Copyright (C) 2017-present Dan <https://github.com/delivrance>
3
+ #
4
+ # This file is part of Pyrogram.
5
+ #
6
+ # Pyrogram is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published
8
+ # by the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # Pyrogram is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18
+
19
+ from enum import auto
20
+ from .auto_name import AutoName
21
+
22
+
23
+ class StoriesPrivacyRules(AutoName):
24
+ """Stories privacy rules type enumeration used in :obj:`~pyrogram.method.SendStory`."""
25
+
26
+ PUBLIC = auto()
27
+ "Public stories"
28
+
29
+ CONTACTS = auto()
30
+ "Contacts only stories"
31
+
32
+ CLOSE_FRIENDS = auto()
33
+ "Close friends stories"
34
+
35
+ SELECTED_USERS = auto()
36
+ "Selected users stories"
@@ -19,7 +19,6 @@
19
19
  from .callback_query_handler import CallbackQueryHandler
20
20
  from .chat_join_request_handler import ChatJoinRequestHandler
21
21
  from .chat_member_updated_handler import ChatMemberUpdatedHandler
22
- from .conversation_handler import ConversationHandler
23
22
  from .chosen_inline_result_handler import ChosenInlineResultHandler
24
23
  from .deleted_messages_handler import DeletedMessagesHandler
25
24
  from .disconnect_handler import DisconnectHandler
@@ -28,4 +27,5 @@ from .inline_query_handler import InlineQueryHandler
28
27
  from .message_handler import MessageHandler
29
28
  from .poll_handler import PollHandler
30
29
  from .raw_update_handler import RawUpdateHandler
31
- from .user_status_handler import UserStatusHandler
30
+ from .story_handler import StoryHandler
31
+ from .user_status_handler import UserStatusHandler
@@ -0,0 +1,49 @@
1
+ # Pyrogram - Telegram MTProto API Client Library for Python
2
+ # Copyright (C) 2017-present Dan <https://github.com/delivrance>
3
+ #
4
+ # This file is part of Pyrogram.
5
+ #
6
+ # Pyrogram is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published
8
+ # by the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # Pyrogram is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18
+
19
+ from typing import Callable
20
+
21
+ from .handler import Handler
22
+
23
+
24
+ class StoryHandler(Handler):
25
+ """The Story handler class. Used to handle new stories.
26
+ It is intended to be used with :meth:`~pyrogram.Client.add_handler`
27
+
28
+ For a nicer way to register this handler, have a look at the
29
+ :meth:`~pyrogram.Client.on_story` decorator.
30
+
31
+ Parameters:
32
+ callback (``Callable``):
33
+ Pass a function that will be called when a new Stories arrives. It takes *(client, story)*
34
+ as positional arguments (look at the section below for a detailed description).
35
+
36
+ filters (:obj:`Filters`):
37
+ Pass one or more filters to allow only a subset of stories to be passed
38
+ in your callback function.
39
+
40
+ Other parameters:
41
+ client (:obj:`~pyrogram.Client`):
42
+ The Client itself, useful when you want to call other API methods inside the story handler.
43
+
44
+ story (:obj:`~pyrogram.types.Story`):
45
+ The received story.
46
+ """
47
+
48
+ def __init__(self, callback: Callable, filters=None):
49
+ super().__init__(callback, filters)
@@ -19,7 +19,9 @@
19
19
  from typing import Union
20
20
 
21
21
  import pyrogram
22
- from pyrogram import raw, utils, types
22
+ from pyrogram import raw
23
+ from pyrogram import types
24
+ from pyrogram import utils
23
25
 
24
26
 
25
27
  class SendGame:
@@ -28,8 +30,8 @@ class SendGame:
28
30
  chat_id: Union[int, str],
29
31
  game_short_name: str,
30
32
  disable_notification: bool = None,
31
- reply_to_message_id: int = None,
32
33
  message_thread_id: int = None,
34
+ reply_to_message_id: int = None,
33
35
  protect_content: bool = None,
34
36
  reply_markup: Union[
35
37
  "types.InlineKeyboardMarkup",
@@ -55,12 +57,13 @@ class SendGame:
55
57
  Sends the message silently.
56
58
  Users will receive a notification with no sound.
57
59
 
60
+ message_thread_id (``int``, *optional*):
61
+ Unique identifier of a message thread to which the message belongs.
62
+ for supergroups only
63
+
58
64
  reply_to_message_id (``int``, *optional*):
59
65
  If the message is a reply, ID of the original message.
60
66
 
61
- message_thread_id (``int``, *optional*):
62
- If the message is in a thread, ID of the original message.
63
-
64
67
  protect_content (``bool``, *optional*):
65
68
  Protects the contents of the sent message from forwarding and saving.
66
69
 
@@ -76,9 +79,6 @@ class SendGame:
76
79
 
77
80
  await app.send_game(chat_id, "gamename")
78
81
  """
79
-
80
- reply_to = utils.get_reply_head_fm(message_thread_id, reply_to_message_id)
81
-
82
82
  r = await self.invoke(
83
83
  raw.functions.messages.SendMedia(
84
84
  peer=await self.resolve_peer(chat_id),
@@ -90,7 +90,7 @@ class SendGame:
90
90
  ),
91
91
  message="",
92
92
  silent=disable_notification or None,
93
- reply_to=reply_to,
93
+ reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id),
94
94
  random_id=self.rnd_id(),
95
95
  noforwards=protect_content,
96
96
  reply_markup=await reply_markup.write(self) if reply_markup else None
@@ -19,7 +19,8 @@
19
19
  from typing import Union
20
20
 
21
21
  import pyrogram
22
- from pyrogram import raw, utils
22
+ from pyrogram import raw
23
+ from pyrogram import utils
23
24
 
24
25
 
25
26
  class SendInlineBotResult:
@@ -29,8 +30,8 @@ class SendInlineBotResult:
29
30
  query_id: int,
30
31
  result_id: str,
31
32
  disable_notification: bool = None,
32
- reply_to_message_id: int = None,
33
- message_thread_id: int = None
33
+ message_thread_id: int = None,
34
+ reply_to_message_id: int = None
34
35
  ) -> "raw.base.Updates":
35
36
  """Send an inline bot result.
36
37
  Bot results can be retrieved using :meth:`~pyrogram.Client.get_inline_bot_results`
@@ -53,11 +54,12 @@ class SendInlineBotResult:
53
54
  Sends the message silently.
54
55
  Users will receive a notification with no sound.
55
56
 
56
- reply_to_message_id (``int``, *optional*):
57
- If the message is a reply, ID of the original message.
58
-
59
57
  message_thread_id (``int``, *optional*):
60
- If the message is in a thread, ID of the original message.
58
+ Unique identifier of a message thread to which the message belongs.
59
+ for supergroups only
60
+
61
+ reply_to_message_id (``bool``, *optional*):
62
+ If the message is a reply, ID of the original message.
61
63
 
62
64
  Returns:
63
65
  :obj:`~pyrogram.raw.base.Updates`: Currently, on success, a raw result is returned.
@@ -67,9 +69,6 @@ class SendInlineBotResult:
67
69
 
68
70
  await app.send_inline_bot_result(chat_id, query_id, result_id)
69
71
  """
70
-
71
- reply_to = utils.get_reply_head_fm(message_thread_id, reply_to_message_id)
72
-
73
72
  return await self.invoke(
74
73
  raw.functions.messages.SendInlineBotResult(
75
74
  peer=await self.resolve_peer(chat_id),
@@ -77,6 +76,6 @@ class SendInlineBotResult:
77
76
  id=result_id,
78
77
  random_id=self.rnd_id(),
79
78
  silent=disable_notification or None,
80
- reply_to=reply_to
79
+ reply_to=utils.get_reply_to(reply_to_message_id, message_thread_id)
81
80
  )
82
81
  )
@@ -28,6 +28,7 @@ from .on_message import OnMessage
28
28
  from .on_poll import OnPoll
29
29
  from .on_raw_update import OnRawUpdate
30
30
  from .on_user_status import OnUserStatus
31
+ from .on_story import OnStory
31
32
 
32
33
 
33
34
  class Decorators(
@@ -42,6 +43,7 @@ class Decorators(
42
43
  OnPoll,
43
44
  OnChosenInlineResult,
44
45
  OnChatMemberUpdated,
45
- OnChatJoinRequest
46
+ OnChatJoinRequest,
47
+ OnStory
46
48
  ):
47
- pass
49
+ pass
@@ -0,0 +1,61 @@
1
+ # Pyrogram - Telegram MTProto API Client Library for Python
2
+ # Copyright (C) 2017-present Dan <https://github.com/delivrance>
3
+ #
4
+ # This file is part of Pyrogram.
5
+ #
6
+ # Pyrogram is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Lesser General Public License as published
8
+ # by the Free Software Foundation, either version 3 of the License, or
9
+ # (at your option) any later version.
10
+ #
11
+ # Pyrogram is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18
+
19
+ from typing import Callable
20
+
21
+ import pyrogram
22
+ from pyrogram.filters import Filter
23
+
24
+
25
+ class OnStory:
26
+ def on_story(
27
+ self=None,
28
+ filters=None,
29
+ group: int = 0
30
+ ) -> Callable:
31
+ """Decorator for handling new stories.
32
+
33
+ This does the same thing as :meth:`~pyrogram.Client.add_handler` using the
34
+ :obj:`~pyrogram.handlers.StoryHandler`.
35
+
36
+ Parameters:
37
+ filters (:obj:`~pyrogram.filters`, *optional*):
38
+ Pass one or more filters to allow only a subset of stories to be passed
39
+ in your function.
40
+
41
+ group (``int``, *optional*):
42
+ The group identifier, defaults to 0.
43
+ """
44
+
45
+ def decorator(func: Callable) -> Callable:
46
+ if isinstance(self, pyrogram.Client):
47
+ self.add_handler(pyrogram.handlers.StoryHandler(func, filters), group)
48
+ elif isinstance(self, Filter) or self is None:
49
+ if not hasattr(func, "handlers"):
50
+ func.handlers = []
51
+
52
+ func.handlers.append(
53
+ (
54
+ pyrogram.handlers.StoryHandler(func, self),
55
+ group if filters is None else filters
56
+ )
57
+ )
58
+
59
+ return func
60
+
61
+ return decorator