legacy-tl-fork 1.8.1__tar.gz

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 (161) hide show
  1. legacy_tl_fork-1.8.1/LICENSE +21 -0
  2. legacy_tl_fork-1.8.1/PKG-INFO +126 -0
  3. legacy_tl_fork-1.8.1/README.rst +87 -0
  4. legacy_tl_fork-1.8.1/legacy_tl_fork.egg-info/PKG-INFO +126 -0
  5. legacy_tl_fork-1.8.1/legacy_tl_fork.egg-info/SOURCES.txt +159 -0
  6. legacy_tl_fork-1.8.1/legacy_tl_fork.egg-info/dependency_links.txt +1 -0
  7. legacy_tl_fork-1.8.1/legacy_tl_fork.egg-info/requires.txt +5 -0
  8. legacy_tl_fork-1.8.1/legacy_tl_fork.egg-info/top_level.txt +1 -0
  9. legacy_tl_fork-1.8.1/legacytl/__init__.py +13 -0
  10. legacy_tl_fork-1.8.1/legacytl/_updates/__init__.py +3 -0
  11. legacy_tl_fork-1.8.1/legacytl/_updates/entitycache.py +59 -0
  12. legacy_tl_fork-1.8.1/legacytl/_updates/messagebox.py +825 -0
  13. legacy_tl_fork-1.8.1/legacytl/_updates/session.py +195 -0
  14. legacy_tl_fork-1.8.1/legacytl/client/__init__.py +25 -0
  15. legacy_tl_fork-1.8.1/legacytl/client/account.py +243 -0
  16. legacy_tl_fork-1.8.1/legacytl/client/auth.py +677 -0
  17. legacy_tl_fork-1.8.1/legacytl/client/bots.py +72 -0
  18. legacy_tl_fork-1.8.1/legacytl/client/buttons.py +101 -0
  19. legacy_tl_fork-1.8.1/legacytl/client/chats.py +1336 -0
  20. legacy_tl_fork-1.8.1/legacytl/client/dialogs.py +610 -0
  21. legacy_tl_fork-1.8.1/legacytl/client/downloads.py +1092 -0
  22. legacy_tl_fork-1.8.1/legacytl/client/messageparse.py +233 -0
  23. legacy_tl_fork-1.8.1/legacytl/client/messages.py +1683 -0
  24. legacy_tl_fork-1.8.1/legacytl/client/telegrambaseclient.py +971 -0
  25. legacy_tl_fork-1.8.1/legacytl/client/telegramclient.py +13 -0
  26. legacy_tl_fork-1.8.1/legacytl/client/updates.py +702 -0
  27. legacy_tl_fork-1.8.1/legacytl/client/uploads.py +969 -0
  28. legacy_tl_fork-1.8.1/legacytl/client/users.py +620 -0
  29. legacy_tl_fork-1.8.1/legacytl/crypto/__init__.py +10 -0
  30. legacy_tl_fork-1.8.1/legacytl/crypto/aes.py +111 -0
  31. legacy_tl_fork-1.8.1/legacytl/crypto/aesctr.py +42 -0
  32. legacy_tl_fork-1.8.1/legacytl/crypto/authkey.py +63 -0
  33. legacy_tl_fork-1.8.1/legacytl/crypto/cdndecrypter.py +105 -0
  34. legacy_tl_fork-1.8.1/legacytl/crypto/factorization.py +67 -0
  35. legacy_tl_fork-1.8.1/legacytl/crypto/libssl.py +140 -0
  36. legacy_tl_fork-1.8.1/legacytl/crypto/rsa.py +165 -0
  37. legacy_tl_fork-1.8.1/legacytl/custom.py +1 -0
  38. legacy_tl_fork-1.8.1/legacytl/errors/__init__.py +46 -0
  39. legacy_tl_fork-1.8.1/legacytl/errors/common.py +180 -0
  40. legacy_tl_fork-1.8.1/legacytl/errors/rpcbaseerrors.py +131 -0
  41. legacy_tl_fork-1.8.1/legacytl/errors/rpcerrorlist.py +5286 -0
  42. legacy_tl_fork-1.8.1/legacytl/events/__init__.py +140 -0
  43. legacy_tl_fork-1.8.1/legacytl/events/album.py +343 -0
  44. legacy_tl_fork-1.8.1/legacytl/events/callbackquery.py +346 -0
  45. legacy_tl_fork-1.8.1/legacytl/events/chataction.py +458 -0
  46. legacy_tl_fork-1.8.1/legacytl/events/common.py +186 -0
  47. legacy_tl_fork-1.8.1/legacytl/events/inlinequery.py +247 -0
  48. legacy_tl_fork-1.8.1/legacytl/events/messagedeleted.py +57 -0
  49. legacy_tl_fork-1.8.1/legacytl/events/messageedited.py +52 -0
  50. legacy_tl_fork-1.8.1/legacytl/events/messageread.py +143 -0
  51. legacy_tl_fork-1.8.1/legacytl/events/newmessage.py +223 -0
  52. legacy_tl_fork-1.8.1/legacytl/events/raw.py +53 -0
  53. legacy_tl_fork-1.8.1/legacytl/events/userupdate.py +310 -0
  54. legacy_tl_fork-1.8.1/legacytl/extensions/__init__.py +6 -0
  55. legacy_tl_fork-1.8.1/legacytl/extensions/binaryreader.py +201 -0
  56. legacy_tl_fork-1.8.1/legacytl/extensions/html.py +355 -0
  57. legacy_tl_fork-1.8.1/legacytl/extensions/markdown.py +193 -0
  58. legacy_tl_fork-1.8.1/legacytl/extensions/messagepacker.py +111 -0
  59. legacy_tl_fork-1.8.1/legacytl/functions.py +1 -0
  60. legacy_tl_fork-1.8.1/legacytl/helpers.py +434 -0
  61. legacy_tl_fork-1.8.1/legacytl/hints.py +63 -0
  62. legacy_tl_fork-1.8.1/legacytl/network/__init__.py +14 -0
  63. legacy_tl_fork-1.8.1/legacytl/network/authenticator.py +212 -0
  64. legacy_tl_fork-1.8.1/legacytl/network/connection/__init__.py +12 -0
  65. legacy_tl_fork-1.8.1/legacytl/network/connection/connection.py +440 -0
  66. legacy_tl_fork-1.8.1/legacytl/network/connection/http.py +39 -0
  67. legacy_tl_fork-1.8.1/legacytl/network/connection/tcpabridged.py +33 -0
  68. legacy_tl_fork-1.8.1/legacytl/network/connection/tcpfull.py +55 -0
  69. legacy_tl_fork-1.8.1/legacytl/network/connection/tcpintermediate.py +46 -0
  70. legacy_tl_fork-1.8.1/legacytl/network/connection/tcpmtproxy.py +165 -0
  71. legacy_tl_fork-1.8.1/legacytl/network/connection/tcpobfuscated.py +62 -0
  72. legacy_tl_fork-1.8.1/legacytl/network/mtprotoplainsender.py +56 -0
  73. legacy_tl_fork-1.8.1/legacytl/network/mtprotosender.py +924 -0
  74. legacy_tl_fork-1.8.1/legacytl/network/mtprotostate.py +285 -0
  75. legacy_tl_fork-1.8.1/legacytl/network/requeststate.py +19 -0
  76. legacy_tl_fork-1.8.1/legacytl/password.py +194 -0
  77. legacy_tl_fork-1.8.1/legacytl/requestiter.py +134 -0
  78. legacy_tl_fork-1.8.1/legacytl/sessions/__init__.py +4 -0
  79. legacy_tl_fork-1.8.1/legacytl/sessions/abstract.py +172 -0
  80. legacy_tl_fork-1.8.1/legacytl/sessions/memory.py +260 -0
  81. legacy_tl_fork-1.8.1/legacytl/sessions/sqlite.py +385 -0
  82. legacy_tl_fork-1.8.1/legacytl/sessions/string.py +63 -0
  83. legacy_tl_fork-1.8.1/legacytl/sync.py +74 -0
  84. legacy_tl_fork-1.8.1/legacytl/tl/__init__.py +1 -0
  85. legacy_tl_fork-1.8.1/legacytl/tl/alltlobjects.py +2179 -0
  86. legacy_tl_fork-1.8.1/legacytl/tl/core/__init__.py +26 -0
  87. legacy_tl_fork-1.8.1/legacytl/tl/core/gzippacked.py +48 -0
  88. legacy_tl_fork-1.8.1/legacytl/tl/core/messagecontainer.py +47 -0
  89. legacy_tl_fork-1.8.1/legacytl/tl/core/rpcresult.py +35 -0
  90. legacy_tl_fork-1.8.1/legacytl/tl/core/tlmessage.py +34 -0
  91. legacy_tl_fork-1.8.1/legacytl/tl/custom/__init__.py +14 -0
  92. legacy_tl_fork-1.8.1/legacytl/tl/custom/adminlogevent.py +475 -0
  93. legacy_tl_fork-1.8.1/legacytl/tl/custom/button.py +346 -0
  94. legacy_tl_fork-1.8.1/legacytl/tl/custom/chatgetter.py +150 -0
  95. legacy_tl_fork-1.8.1/legacytl/tl/custom/conversation.py +529 -0
  96. legacy_tl_fork-1.8.1/legacytl/tl/custom/dialog.py +161 -0
  97. legacy_tl_fork-1.8.1/legacytl/tl/custom/draft.py +191 -0
  98. legacy_tl_fork-1.8.1/legacytl/tl/custom/file.py +146 -0
  99. legacy_tl_fork-1.8.1/legacytl/tl/custom/forward.py +51 -0
  100. legacy_tl_fork-1.8.1/legacytl/tl/custom/inlinebuilder.py +450 -0
  101. legacy_tl_fork-1.8.1/legacytl/tl/custom/inlineresult.py +176 -0
  102. legacy_tl_fork-1.8.1/legacytl/tl/custom/inlineresults.py +83 -0
  103. legacy_tl_fork-1.8.1/legacytl/tl/custom/inputsizedfile.py +9 -0
  104. legacy_tl_fork-1.8.1/legacytl/tl/custom/message.py +1338 -0
  105. legacy_tl_fork-1.8.1/legacytl/tl/custom/messagebutton.py +154 -0
  106. legacy_tl_fork-1.8.1/legacytl/tl/custom/participantpermissions.py +138 -0
  107. legacy_tl_fork-1.8.1/legacytl/tl/custom/qrlogin.py +119 -0
  108. legacy_tl_fork-1.8.1/legacytl/tl/custom/sendergetter.py +102 -0
  109. legacy_tl_fork-1.8.1/legacytl/tl/functions/__init__.py +717 -0
  110. legacy_tl_fork-1.8.1/legacytl/tl/functions/account.py +3633 -0
  111. legacy_tl_fork-1.8.1/legacytl/tl/functions/auth.py +802 -0
  112. legacy_tl_fork-1.8.1/legacytl/tl/functions/bots.py +1125 -0
  113. legacy_tl_fork-1.8.1/legacytl/tl/functions/channels.py +2442 -0
  114. legacy_tl_fork-1.8.1/legacytl/tl/functions/chatlists.py +425 -0
  115. legacy_tl_fork-1.8.1/legacytl/tl/functions/contacts.py +912 -0
  116. legacy_tl_fork-1.8.1/legacytl/tl/functions/folders.py +44 -0
  117. legacy_tl_fork-1.8.1/legacytl/tl/functions/fragment.py +39 -0
  118. legacy_tl_fork-1.8.1/legacytl/tl/functions/help.py +672 -0
  119. legacy_tl_fork-1.8.1/legacytl/tl/functions/langpack.py +178 -0
  120. legacy_tl_fork-1.8.1/legacytl/tl/functions/messages.py +9443 -0
  121. legacy_tl_fork-1.8.1/legacytl/tl/functions/payments.py +1725 -0
  122. legacy_tl_fork-1.8.1/legacytl/tl/functions/phone.py +1296 -0
  123. legacy_tl_fork-1.8.1/legacytl/tl/functions/photos.py +282 -0
  124. legacy_tl_fork-1.8.1/legacytl/tl/functions/premium.py +188 -0
  125. legacy_tl_fork-1.8.1/legacytl/tl/functions/smsjobs.py +180 -0
  126. legacy_tl_fork-1.8.1/legacytl/tl/functions/stats.py +402 -0
  127. legacy_tl_fork-1.8.1/legacytl/tl/functions/stickers.py +440 -0
  128. legacy_tl_fork-1.8.1/legacytl/tl/functions/stories.py +1180 -0
  129. legacy_tl_fork-1.8.1/legacytl/tl/functions/updates.py +139 -0
  130. legacy_tl_fork-1.8.1/legacytl/tl/functions/upload.py +300 -0
  131. legacy_tl_fork-1.8.1/legacytl/tl/functions/users.py +162 -0
  132. legacy_tl_fork-1.8.1/legacytl/tl/patched/__init__.py +20 -0
  133. legacy_tl_fork-1.8.1/legacytl/tl/tlobject.py +222 -0
  134. legacy_tl_fork-1.8.1/legacytl/tl/types/__init__.py +45403 -0
  135. legacy_tl_fork-1.8.1/legacytl/tl/types/account.py +1230 -0
  136. legacy_tl_fork-1.8.1/legacytl/tl/types/auth.py +892 -0
  137. legacy_tl_fork-1.8.1/legacytl/tl/types/bots.py +131 -0
  138. legacy_tl_fork-1.8.1/legacytl/tl/types/channels.py +307 -0
  139. legacy_tl_fork-1.8.1/legacytl/tl/types/chatlists.py +276 -0
  140. legacy_tl_fork-1.8.1/legacytl/tl/types/contacts.py +548 -0
  141. legacy_tl_fork-1.8.1/legacytl/tl/types/fragment.py +55 -0
  142. legacy_tl_fork-1.8.1/legacytl/tl/types/help.py +1220 -0
  143. legacy_tl_fork-1.8.1/legacytl/tl/types/messages.py +3620 -0
  144. legacy_tl_fork-1.8.1/legacytl/tl/types/payments.py +1329 -0
  145. legacy_tl_fork-1.8.1/legacytl/tl/types/phone.py +313 -0
  146. legacy_tl_fork-1.8.1/legacytl/tl/types/photos.py +135 -0
  147. legacy_tl_fork-1.8.1/legacytl/tl/types/premium.py +209 -0
  148. legacy_tl_fork-1.8.1/legacytl/tl/types/smsjobs.py +100 -0
  149. legacy_tl_fork-1.8.1/legacytl/tl/types/stats.py +473 -0
  150. legacy_tl_fork-1.8.1/legacytl/tl/types/stickers.py +35 -0
  151. legacy_tl_fork-1.8.1/legacytl/tl/types/storage.py +197 -0
  152. legacy_tl_fork-1.8.1/legacytl/tl/types/stories.py +479 -0
  153. legacy_tl_fork-1.8.1/legacytl/tl/types/updates.py +447 -0
  154. legacy_tl_fork-1.8.1/legacytl/tl/types/upload.py +196 -0
  155. legacy_tl_fork-1.8.1/legacytl/tl/types/users.py +126 -0
  156. legacy_tl_fork-1.8.1/legacytl/types.py +1 -0
  157. legacy_tl_fork-1.8.1/legacytl/utils.py +1687 -0
  158. legacy_tl_fork-1.8.1/legacytl/version.py +3 -0
  159. legacy_tl_fork-1.8.1/pyproject.toml +36 -0
  160. legacy_tl_fork-1.8.1/setup.cfg +4 -0
  161. legacy_tl_fork-1.8.1/setup.py +277 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016-Present LonamiWebs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: legacy-tl-fork
3
+ Version: 1.8.1
4
+ Summary: Full-featured Telegram client library for Python 3
5
+ Home-page: https://github.com/xdesai96/tlh-legacy
6
+ Download-URL: https://github.com/xdesai96/tlh-legacy/releases
7
+ Author: xdesai96
8
+ Author-email: xdesai@proton.me
9
+ License: MIT
10
+ Keywords: telegram api chat client library messaging mtproto
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Communications :: Chat
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.5
17
+ Classifier: Programming Language :: Python :: 3.6
18
+ Classifier: Programming Language :: Python :: 3.7
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Requires-Python: >=3.8
21
+ License-File: LICENSE
22
+ Requires-Dist: pyaes
23
+ Requires-Dist: rsa
24
+ Provides-Extra: cryptg
25
+ Requires-Dist: cryptg; extra == "cryptg"
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: download-url
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: provides-extra
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
39
+
40
+ Telethon
41
+ ========
42
+ .. epigraph::
43
+
44
+ ⭐️ Thanks **everyone** who has starred the project, it means a lot!
45
+
46
+ |logo| **Telethon** is an asyncio_ **Python 3**
47
+ MTProto_ library to interact with Telegram_'s API
48
+ as a user or through a bot account (bot API alternative).
49
+
50
+ .. important::
51
+
52
+ If you have code using Telethon before its 1.0 version, you must
53
+ read `Compatibility and Convenience`_ to learn how to migrate.
54
+ As with any third-party library for Telegram, be careful not to
55
+ break `Telegram's ToS`_ or `Telegram can ban the account`_.
56
+
57
+ What is this?
58
+ -------------
59
+
60
+ Telegram is a popular messaging application. This library is meant
61
+ to make it easy for you to write Python programs that can interact
62
+ with Telegram. Think of it as a wrapper that has already done the
63
+ heavy job for you, so you can focus on developing an application.
64
+
65
+
66
+ Installing
67
+ ----------
68
+
69
+ .. code-block:: sh
70
+
71
+ pip3 install telethon
72
+
73
+
74
+ Creating a client
75
+ -----------------
76
+
77
+ .. code-block:: python
78
+
79
+ from telethon import TelegramClient, events, sync
80
+
81
+ # These example values won't work. You must get your own api_id and
82
+ # api_hash from https://my.telegram.org, under API Development.
83
+ api_id = 12345
84
+ api_hash = '0123456789abcdef0123456789abcdef'
85
+
86
+ client = TelegramClient('session_name', api_id, api_hash)
87
+ client.start()
88
+
89
+
90
+ Doing stuff
91
+ -----------
92
+
93
+ .. code-block:: python
94
+
95
+ print(client.get_me().stringify())
96
+
97
+ client.send_message('username', 'Hello! Talking to you from Telethon')
98
+ client.send_file('username', '/home/myself/Pictures/holidays.jpg')
99
+
100
+ client.download_profile_photo('me')
101
+ messages = client.get_messages('username')
102
+ messages[0].download_media()
103
+
104
+ @client.on(events.NewMessage(pattern='(?i)hi|hello'))
105
+ async def handler(event):
106
+ await event.respond('Hey!')
107
+
108
+
109
+ Next steps
110
+ ----------
111
+
112
+ Do you like how Telethon looks? Check out `Read The Docs`_ for a more
113
+ in-depth explanation, with examples, troubleshooting issues, and more
114
+ useful information.
115
+
116
+ .. _asyncio: https://docs.python.org/3/library/asyncio.html
117
+ .. _MTProto: https://core.telegram.org/mtproto
118
+ .. _Telegram: https://telegram.org
119
+ .. _Compatibility and Convenience: https://docs.telethon.dev/en/stable/misc/compatibility-and-convenience.html
120
+ .. _Telegram's ToS: https://core.telegram.org/api/terms
121
+ .. _Telegram can ban the account: https://docs.telethon.dev/en/stable/quick-references/faq.html#my-account-was-deleted-limited-when-using-the-library
122
+ .. _Read The Docs: https://docs.telethon.dev
123
+
124
+ .. |logo| image:: logo.svg
125
+ :width: 24pt
126
+ :height: 24pt
@@ -0,0 +1,87 @@
1
+ Telethon
2
+ ========
3
+ .. epigraph::
4
+
5
+ ⭐️ Thanks **everyone** who has starred the project, it means a lot!
6
+
7
+ |logo| **Telethon** is an asyncio_ **Python 3**
8
+ MTProto_ library to interact with Telegram_'s API
9
+ as a user or through a bot account (bot API alternative).
10
+
11
+ .. important::
12
+
13
+ If you have code using Telethon before its 1.0 version, you must
14
+ read `Compatibility and Convenience`_ to learn how to migrate.
15
+ As with any third-party library for Telegram, be careful not to
16
+ break `Telegram's ToS`_ or `Telegram can ban the account`_.
17
+
18
+ What is this?
19
+ -------------
20
+
21
+ Telegram is a popular messaging application. This library is meant
22
+ to make it easy for you to write Python programs that can interact
23
+ with Telegram. Think of it as a wrapper that has already done the
24
+ heavy job for you, so you can focus on developing an application.
25
+
26
+
27
+ Installing
28
+ ----------
29
+
30
+ .. code-block:: sh
31
+
32
+ pip3 install telethon
33
+
34
+
35
+ Creating a client
36
+ -----------------
37
+
38
+ .. code-block:: python
39
+
40
+ from telethon import TelegramClient, events, sync
41
+
42
+ # These example values won't work. You must get your own api_id and
43
+ # api_hash from https://my.telegram.org, under API Development.
44
+ api_id = 12345
45
+ api_hash = '0123456789abcdef0123456789abcdef'
46
+
47
+ client = TelegramClient('session_name', api_id, api_hash)
48
+ client.start()
49
+
50
+
51
+ Doing stuff
52
+ -----------
53
+
54
+ .. code-block:: python
55
+
56
+ print(client.get_me().stringify())
57
+
58
+ client.send_message('username', 'Hello! Talking to you from Telethon')
59
+ client.send_file('username', '/home/myself/Pictures/holidays.jpg')
60
+
61
+ client.download_profile_photo('me')
62
+ messages = client.get_messages('username')
63
+ messages[0].download_media()
64
+
65
+ @client.on(events.NewMessage(pattern='(?i)hi|hello'))
66
+ async def handler(event):
67
+ await event.respond('Hey!')
68
+
69
+
70
+ Next steps
71
+ ----------
72
+
73
+ Do you like how Telethon looks? Check out `Read The Docs`_ for a more
74
+ in-depth explanation, with examples, troubleshooting issues, and more
75
+ useful information.
76
+
77
+ .. _asyncio: https://docs.python.org/3/library/asyncio.html
78
+ .. _MTProto: https://core.telegram.org/mtproto
79
+ .. _Telegram: https://telegram.org
80
+ .. _Compatibility and Convenience: https://docs.telethon.dev/en/stable/misc/compatibility-and-convenience.html
81
+ .. _Telegram's ToS: https://core.telegram.org/api/terms
82
+ .. _Telegram can ban the account: https://docs.telethon.dev/en/stable/quick-references/faq.html#my-account-was-deleted-limited-when-using-the-library
83
+ .. _Read The Docs: https://docs.telethon.dev
84
+
85
+ .. |logo| image:: logo.svg
86
+ :width: 24pt
87
+ :height: 24pt
@@ -0,0 +1,126 @@
1
+ Metadata-Version: 2.4
2
+ Name: legacy-tl-fork
3
+ Version: 1.8.1
4
+ Summary: Full-featured Telegram client library for Python 3
5
+ Home-page: https://github.com/xdesai96/tlh-legacy
6
+ Download-URL: https://github.com/xdesai96/tlh-legacy/releases
7
+ Author: xdesai96
8
+ Author-email: xdesai@proton.me
9
+ License: MIT
10
+ Keywords: telegram api chat client library messaging mtproto
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Communications :: Chat
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.5
17
+ Classifier: Programming Language :: Python :: 3.6
18
+ Classifier: Programming Language :: Python :: 3.7
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Requires-Python: >=3.8
21
+ License-File: LICENSE
22
+ Requires-Dist: pyaes
23
+ Requires-Dist: rsa
24
+ Provides-Extra: cryptg
25
+ Requires-Dist: cryptg; extra == "cryptg"
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: download-url
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: license-file
35
+ Dynamic: provides-extra
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
39
+
40
+ Telethon
41
+ ========
42
+ .. epigraph::
43
+
44
+ ⭐️ Thanks **everyone** who has starred the project, it means a lot!
45
+
46
+ |logo| **Telethon** is an asyncio_ **Python 3**
47
+ MTProto_ library to interact with Telegram_'s API
48
+ as a user or through a bot account (bot API alternative).
49
+
50
+ .. important::
51
+
52
+ If you have code using Telethon before its 1.0 version, you must
53
+ read `Compatibility and Convenience`_ to learn how to migrate.
54
+ As with any third-party library for Telegram, be careful not to
55
+ break `Telegram's ToS`_ or `Telegram can ban the account`_.
56
+
57
+ What is this?
58
+ -------------
59
+
60
+ Telegram is a popular messaging application. This library is meant
61
+ to make it easy for you to write Python programs that can interact
62
+ with Telegram. Think of it as a wrapper that has already done the
63
+ heavy job for you, so you can focus on developing an application.
64
+
65
+
66
+ Installing
67
+ ----------
68
+
69
+ .. code-block:: sh
70
+
71
+ pip3 install telethon
72
+
73
+
74
+ Creating a client
75
+ -----------------
76
+
77
+ .. code-block:: python
78
+
79
+ from telethon import TelegramClient, events, sync
80
+
81
+ # These example values won't work. You must get your own api_id and
82
+ # api_hash from https://my.telegram.org, under API Development.
83
+ api_id = 12345
84
+ api_hash = '0123456789abcdef0123456789abcdef'
85
+
86
+ client = TelegramClient('session_name', api_id, api_hash)
87
+ client.start()
88
+
89
+
90
+ Doing stuff
91
+ -----------
92
+
93
+ .. code-block:: python
94
+
95
+ print(client.get_me().stringify())
96
+
97
+ client.send_message('username', 'Hello! Talking to you from Telethon')
98
+ client.send_file('username', '/home/myself/Pictures/holidays.jpg')
99
+
100
+ client.download_profile_photo('me')
101
+ messages = client.get_messages('username')
102
+ messages[0].download_media()
103
+
104
+ @client.on(events.NewMessage(pattern='(?i)hi|hello'))
105
+ async def handler(event):
106
+ await event.respond('Hey!')
107
+
108
+
109
+ Next steps
110
+ ----------
111
+
112
+ Do you like how Telethon looks? Check out `Read The Docs`_ for a more
113
+ in-depth explanation, with examples, troubleshooting issues, and more
114
+ useful information.
115
+
116
+ .. _asyncio: https://docs.python.org/3/library/asyncio.html
117
+ .. _MTProto: https://core.telegram.org/mtproto
118
+ .. _Telegram: https://telegram.org
119
+ .. _Compatibility and Convenience: https://docs.telethon.dev/en/stable/misc/compatibility-and-convenience.html
120
+ .. _Telegram's ToS: https://core.telegram.org/api/terms
121
+ .. _Telegram can ban the account: https://docs.telethon.dev/en/stable/quick-references/faq.html#my-account-was-deleted-limited-when-using-the-library
122
+ .. _Read The Docs: https://docs.telethon.dev
123
+
124
+ .. |logo| image:: logo.svg
125
+ :width: 24pt
126
+ :height: 24pt
@@ -0,0 +1,159 @@
1
+ LICENSE
2
+ README.rst
3
+ pyproject.toml
4
+ setup.py
5
+ legacy_tl_fork.egg-info/PKG-INFO
6
+ legacy_tl_fork.egg-info/SOURCES.txt
7
+ legacy_tl_fork.egg-info/dependency_links.txt
8
+ legacy_tl_fork.egg-info/requires.txt
9
+ legacy_tl_fork.egg-info/top_level.txt
10
+ legacytl/__init__.py
11
+ legacytl/custom.py
12
+ legacytl/functions.py
13
+ legacytl/helpers.py
14
+ legacytl/hints.py
15
+ legacytl/password.py
16
+ legacytl/requestiter.py
17
+ legacytl/sync.py
18
+ legacytl/types.py
19
+ legacytl/utils.py
20
+ legacytl/version.py
21
+ legacytl/_updates/__init__.py
22
+ legacytl/_updates/entitycache.py
23
+ legacytl/_updates/messagebox.py
24
+ legacytl/_updates/session.py
25
+ legacytl/client/__init__.py
26
+ legacytl/client/account.py
27
+ legacytl/client/auth.py
28
+ legacytl/client/bots.py
29
+ legacytl/client/buttons.py
30
+ legacytl/client/chats.py
31
+ legacytl/client/dialogs.py
32
+ legacytl/client/downloads.py
33
+ legacytl/client/messageparse.py
34
+ legacytl/client/messages.py
35
+ legacytl/client/telegrambaseclient.py
36
+ legacytl/client/telegramclient.py
37
+ legacytl/client/updates.py
38
+ legacytl/client/uploads.py
39
+ legacytl/client/users.py
40
+ legacytl/crypto/__init__.py
41
+ legacytl/crypto/aes.py
42
+ legacytl/crypto/aesctr.py
43
+ legacytl/crypto/authkey.py
44
+ legacytl/crypto/cdndecrypter.py
45
+ legacytl/crypto/factorization.py
46
+ legacytl/crypto/libssl.py
47
+ legacytl/crypto/rsa.py
48
+ legacytl/errors/__init__.py
49
+ legacytl/errors/common.py
50
+ legacytl/errors/rpcbaseerrors.py
51
+ legacytl/errors/rpcerrorlist.py
52
+ legacytl/events/__init__.py
53
+ legacytl/events/album.py
54
+ legacytl/events/callbackquery.py
55
+ legacytl/events/chataction.py
56
+ legacytl/events/common.py
57
+ legacytl/events/inlinequery.py
58
+ legacytl/events/messagedeleted.py
59
+ legacytl/events/messageedited.py
60
+ legacytl/events/messageread.py
61
+ legacytl/events/newmessage.py
62
+ legacytl/events/raw.py
63
+ legacytl/events/userupdate.py
64
+ legacytl/extensions/__init__.py
65
+ legacytl/extensions/binaryreader.py
66
+ legacytl/extensions/html.py
67
+ legacytl/extensions/markdown.py
68
+ legacytl/extensions/messagepacker.py
69
+ legacytl/network/__init__.py
70
+ legacytl/network/authenticator.py
71
+ legacytl/network/mtprotoplainsender.py
72
+ legacytl/network/mtprotosender.py
73
+ legacytl/network/mtprotostate.py
74
+ legacytl/network/requeststate.py
75
+ legacytl/network/connection/__init__.py
76
+ legacytl/network/connection/connection.py
77
+ legacytl/network/connection/http.py
78
+ legacytl/network/connection/tcpabridged.py
79
+ legacytl/network/connection/tcpfull.py
80
+ legacytl/network/connection/tcpintermediate.py
81
+ legacytl/network/connection/tcpmtproxy.py
82
+ legacytl/network/connection/tcpobfuscated.py
83
+ legacytl/sessions/__init__.py
84
+ legacytl/sessions/abstract.py
85
+ legacytl/sessions/memory.py
86
+ legacytl/sessions/sqlite.py
87
+ legacytl/sessions/string.py
88
+ legacytl/tl/__init__.py
89
+ legacytl/tl/alltlobjects.py
90
+ legacytl/tl/tlobject.py
91
+ legacytl/tl/core/__init__.py
92
+ legacytl/tl/core/gzippacked.py
93
+ legacytl/tl/core/messagecontainer.py
94
+ legacytl/tl/core/rpcresult.py
95
+ legacytl/tl/core/tlmessage.py
96
+ legacytl/tl/custom/__init__.py
97
+ legacytl/tl/custom/adminlogevent.py
98
+ legacytl/tl/custom/button.py
99
+ legacytl/tl/custom/chatgetter.py
100
+ legacytl/tl/custom/conversation.py
101
+ legacytl/tl/custom/dialog.py
102
+ legacytl/tl/custom/draft.py
103
+ legacytl/tl/custom/file.py
104
+ legacytl/tl/custom/forward.py
105
+ legacytl/tl/custom/inlinebuilder.py
106
+ legacytl/tl/custom/inlineresult.py
107
+ legacytl/tl/custom/inlineresults.py
108
+ legacytl/tl/custom/inputsizedfile.py
109
+ legacytl/tl/custom/message.py
110
+ legacytl/tl/custom/messagebutton.py
111
+ legacytl/tl/custom/participantpermissions.py
112
+ legacytl/tl/custom/qrlogin.py
113
+ legacytl/tl/custom/sendergetter.py
114
+ legacytl/tl/functions/__init__.py
115
+ legacytl/tl/functions/account.py
116
+ legacytl/tl/functions/auth.py
117
+ legacytl/tl/functions/bots.py
118
+ legacytl/tl/functions/channels.py
119
+ legacytl/tl/functions/chatlists.py
120
+ legacytl/tl/functions/contacts.py
121
+ legacytl/tl/functions/folders.py
122
+ legacytl/tl/functions/fragment.py
123
+ legacytl/tl/functions/help.py
124
+ legacytl/tl/functions/langpack.py
125
+ legacytl/tl/functions/messages.py
126
+ legacytl/tl/functions/payments.py
127
+ legacytl/tl/functions/phone.py
128
+ legacytl/tl/functions/photos.py
129
+ legacytl/tl/functions/premium.py
130
+ legacytl/tl/functions/smsjobs.py
131
+ legacytl/tl/functions/stats.py
132
+ legacytl/tl/functions/stickers.py
133
+ legacytl/tl/functions/stories.py
134
+ legacytl/tl/functions/updates.py
135
+ legacytl/tl/functions/upload.py
136
+ legacytl/tl/functions/users.py
137
+ legacytl/tl/patched/__init__.py
138
+ legacytl/tl/types/__init__.py
139
+ legacytl/tl/types/account.py
140
+ legacytl/tl/types/auth.py
141
+ legacytl/tl/types/bots.py
142
+ legacytl/tl/types/channels.py
143
+ legacytl/tl/types/chatlists.py
144
+ legacytl/tl/types/contacts.py
145
+ legacytl/tl/types/fragment.py
146
+ legacytl/tl/types/help.py
147
+ legacytl/tl/types/messages.py
148
+ legacytl/tl/types/payments.py
149
+ legacytl/tl/types/phone.py
150
+ legacytl/tl/types/photos.py
151
+ legacytl/tl/types/premium.py
152
+ legacytl/tl/types/smsjobs.py
153
+ legacytl/tl/types/stats.py
154
+ legacytl/tl/types/stickers.py
155
+ legacytl/tl/types/storage.py
156
+ legacytl/tl/types/stories.py
157
+ legacytl/tl/types/updates.py
158
+ legacytl/tl/types/upload.py
159
+ legacytl/tl/types/users.py
@@ -0,0 +1,5 @@
1
+ pyaes
2
+ rsa
3
+
4
+ [cryptg]
5
+ cryptg
@@ -0,0 +1,13 @@
1
+ from .client.telegramclient import TelegramClient
2
+ from .network import connection
3
+ from .tl.custom import Button
4
+ from .tl import patched as _ # import for its side-effects
5
+ from . import version, events, utils, errors, types, functions, custom
6
+
7
+ __version__ = version.__version__
8
+
9
+ __all__ = [
10
+ 'TelegramClient', 'Button',
11
+ 'types', 'functions', 'custom', 'errors',
12
+ 'events', 'utils', 'connection'
13
+ ]
@@ -0,0 +1,3 @@
1
+ from .entitycache import EntityCache
2
+ from .messagebox import MessageBox, GapError, PrematureEndReason
3
+ from .session import SessionState, ChannelState, Entity, EntityType
@@ -0,0 +1,59 @@
1
+ from .session import EntityType, Entity
2
+
3
+
4
+ _sentinel = object()
5
+
6
+
7
+ class EntityCache:
8
+ def __init__(
9
+ self,
10
+ hash_map: dict = _sentinel,
11
+ self_id: int = None,
12
+ self_bot: bool = None
13
+ ):
14
+ self.hash_map = {} if hash_map is _sentinel else hash_map
15
+ self.self_id = self_id
16
+ self.self_bot = self_bot
17
+
18
+ def set_self_user(self, id, bot, hash):
19
+ self.self_id = id
20
+ self.self_bot = bot
21
+ if hash:
22
+ self.hash_map[id] = (hash, EntityType.BOT if bot else EntityType.USER)
23
+
24
+ def get(self, id):
25
+ try:
26
+ hash, ty = self.hash_map[id]
27
+ return Entity(ty, id, hash)
28
+ except KeyError:
29
+ return None
30
+
31
+ def extend(self, users, chats):
32
+ # See https://core.telegram.org/api/min for "issues" with "min constructors".
33
+ self.hash_map.update(
34
+ (u.id, (
35
+ u.access_hash,
36
+ EntityType.BOT if u.bot else EntityType.USER,
37
+ ))
38
+ for u in users
39
+ if getattr(u, 'access_hash', None) and not u.min
40
+ )
41
+ self.hash_map.update(
42
+ (c.id, (
43
+ c.access_hash,
44
+ EntityType.MEGAGROUP if c.megagroup else (
45
+ EntityType.GIGAGROUP if getattr(c, 'gigagroup', None) else EntityType.CHANNEL
46
+ ),
47
+ ))
48
+ for c in chats
49
+ if getattr(c, 'access_hash', None) and not getattr(c, 'min', None)
50
+ )
51
+
52
+ def put(self, entity):
53
+ self.hash_map[entity.id] = (entity.hash, entity.ty)
54
+
55
+ def retain(self, filter):
56
+ self.hash_map = {k: v for k, v in self.hash_map.items() if filter(k)}
57
+
58
+ def __len__(self):
59
+ return len(self.hash_map)