soroushthon 0.2.21__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 (261) hide show
  1. soroushthon-0.2.21/.github/workflows/check.yml +27 -0
  2. soroushthon-0.2.21/.gitignore +81 -0
  3. soroushthon-0.2.21/AUDIT.md +92 -0
  4. soroushthon-0.2.21/CAPABILITIES.json +2657 -0
  5. soroushthon-0.2.21/CAPABILITIES.md +148 -0
  6. soroushthon-0.2.21/INTERACTIONS.md +64 -0
  7. soroushthon-0.2.21/LICENSE +674 -0
  8. soroushthon-0.2.21/MANIFEST.in +14 -0
  9. soroushthon-0.2.21/MEDIA.md +76 -0
  10. soroushthon-0.2.21/NOTICE.md +7 -0
  11. soroushthon-0.2.21/PARITY.md +44 -0
  12. soroushthon-0.2.21/PKG-INFO +65 -0
  13. soroushthon-0.2.21/PROTOCOL.md +52 -0
  14. soroushthon-0.2.21/PUBLISHING.md +112 -0
  15. soroushthon-0.2.21/PYPI_README.md +41 -0
  16. soroushthon-0.2.21/README.md +188 -0
  17. soroushthon-0.2.21/RUBIKA_REVIEW.md +52 -0
  18. soroushthon-0.2.21/SPLUSTHON_COMPAT.md +47 -0
  19. soroushthon-0.2.21/TELETHON_LICENSE +21 -0
  20. soroushthon-0.2.21/examples/coverage.py +223 -0
  21. soroushthon-0.2.21/examples/event_coverage.py +113 -0
  22. soroushthon-0.2.21/examples/interactive_coverage.py +136 -0
  23. soroushthon-0.2.21/examples/media_coverage.py +124 -0
  24. soroushthon-0.2.21/examples/media_fixtures/audio.mp3 +0 -0
  25. soroushthon-0.2.21/examples/media_fixtures/document.txt +1 -0
  26. soroushthon-0.2.21/examples/media_fixtures/photo.png +0 -0
  27. soroushthon-0.2.21/examples/media_fixtures/video.mp4 +0 -0
  28. soroushthon-0.2.21/examples/media_fixtures/voice.ogg +0 -0
  29. soroushthon-0.2.21/examples/multipart_coverage.py +352 -0
  30. soroushthon-0.2.21/examples/other_bio.py +31 -0
  31. soroushthon-0.2.21/examples/profile.py +28 -0
  32. soroushthon-0.2.21/examples/whoami.py +21 -0
  33. soroushthon-0.2.21/pyproject.toml +32 -0
  34. soroushthon-0.2.21/setup.cfg +4 -0
  35. soroushthon-0.2.21/setup.py +3 -0
  36. soroushthon-0.2.21/soroushthon/__init__.py +13 -0
  37. soroushthon-0.2.21/soroushthon/_updates/__init__.py +3 -0
  38. soroushthon-0.2.21/soroushthon/_updates/entitycache.py +59 -0
  39. soroushthon-0.2.21/soroushthon/_updates/messagebox.py +830 -0
  40. soroushthon-0.2.21/soroushthon/_updates/session.py +195 -0
  41. soroushthon-0.2.21/soroushthon/client/__init__.py +26 -0
  42. soroushthon-0.2.21/soroushthon/client/account.py +278 -0
  43. soroushthon-0.2.21/soroushthon/client/auth.py +744 -0
  44. soroushthon-0.2.21/soroushthon/client/bots.py +72 -0
  45. soroushthon-0.2.21/soroushthon/client/buttons.py +101 -0
  46. soroushthon-0.2.21/soroushthon/client/chats.py +1346 -0
  47. soroushthon-0.2.21/soroushthon/client/dialogs.py +628 -0
  48. soroushthon-0.2.21/soroushthon/client/downloads.py +1120 -0
  49. soroushthon-0.2.21/soroushthon/client/interactions.py +252 -0
  50. soroushthon-0.2.21/soroushthon/client/messageparse.py +238 -0
  51. soroushthon-0.2.21/soroushthon/client/messages.py +1531 -0
  52. soroushthon-0.2.21/soroushthon/client/soroushclient.py +57 -0
  53. soroushthon-0.2.21/soroushthon/client/telegrambaseclient.py +1110 -0
  54. soroushthon-0.2.21/soroushthon/client/updates.py +793 -0
  55. soroushthon-0.2.21/soroushthon/client/uploads.py +877 -0
  56. soroushthon-0.2.21/soroushthon/client/users.py +703 -0
  57. soroushthon-0.2.21/soroushthon/crypto/__init__.py +10 -0
  58. soroushthon-0.2.21/soroushthon/crypto/aes.py +111 -0
  59. soroushthon-0.2.21/soroushthon/crypto/aesctr.py +42 -0
  60. soroushthon-0.2.21/soroushthon/crypto/authkey.py +63 -0
  61. soroushthon-0.2.21/soroushthon/crypto/cdndecrypter.py +109 -0
  62. soroushthon-0.2.21/soroushthon/crypto/factorization.py +67 -0
  63. soroushthon-0.2.21/soroushthon/crypto/libssl.py +138 -0
  64. soroushthon-0.2.21/soroushthon/crypto/rsa.py +268 -0
  65. soroushthon-0.2.21/soroushthon/custom.py +1 -0
  66. soroushthon-0.2.21/soroushthon/errors/__init__.py +46 -0
  67. soroushthon-0.2.21/soroushthon/errors/common.py +180 -0
  68. soroushthon-0.2.21/soroushthon/errors/rpcbaseerrors.py +135 -0
  69. soroushthon-0.2.21/soroushthon/errors/rpcerrorlist.py +5356 -0
  70. soroushthon-0.2.21/soroushthon/events/__init__.py +139 -0
  71. soroushthon-0.2.21/soroushthon/events/album.py +345 -0
  72. soroushthon-0.2.21/soroushthon/events/callbackquery.py +345 -0
  73. soroushthon-0.2.21/soroushthon/events/chataction.py +458 -0
  74. soroushthon-0.2.21/soroushthon/events/common.py +186 -0
  75. soroushthon-0.2.21/soroushthon/events/inlinequery.py +247 -0
  76. soroushthon-0.2.21/soroushthon/events/messagedeleted.py +57 -0
  77. soroushthon-0.2.21/soroushthon/events/messageedited.py +52 -0
  78. soroushthon-0.2.21/soroushthon/events/messageread.py +143 -0
  79. soroushthon-0.2.21/soroushthon/events/newmessage.py +223 -0
  80. soroushthon-0.2.21/soroushthon/events/raw.py +53 -0
  81. soroushthon-0.2.21/soroushthon/events/userupdate.py +310 -0
  82. soroushthon-0.2.21/soroushthon/extensions/__init__.py +6 -0
  83. soroushthon-0.2.21/soroushthon/extensions/binaryreader.py +210 -0
  84. soroushthon-0.2.21/soroushthon/extensions/html.py +208 -0
  85. soroushthon-0.2.21/soroushthon/extensions/markdown.py +193 -0
  86. soroushthon-0.2.21/soroushthon/extensions/messagepacker.py +122 -0
  87. soroushthon-0.2.21/soroushthon/functions.py +1 -0
  88. soroushthon-0.2.21/soroushthon/helpers.py +434 -0
  89. soroushthon-0.2.21/soroushthon/hints.py +72 -0
  90. soroushthon-0.2.21/soroushthon/network/__init__.py +14 -0
  91. soroushthon-0.2.21/soroushthon/network/authenticator.py +212 -0
  92. soroushthon-0.2.21/soroushthon/network/connection/__init__.py +13 -0
  93. soroushthon-0.2.21/soroushthon/network/connection/connection.py +455 -0
  94. soroushthon-0.2.21/soroushthon/network/connection/http.py +39 -0
  95. soroushthon-0.2.21/soroushthon/network/connection/tcpabridged.py +33 -0
  96. soroushthon-0.2.21/soroushthon/network/connection/tcpfull.py +58 -0
  97. soroushthon-0.2.21/soroushthon/network/connection/tcpintermediate.py +46 -0
  98. soroushthon-0.2.21/soroushthon/network/connection/tcpmtproxy.py +165 -0
  99. soroushthon-0.2.21/soroushthon/network/connection/tcpobfuscated.py +62 -0
  100. soroushthon-0.2.21/soroushthon/network/connection/websocket.py +433 -0
  101. soroushthon-0.2.21/soroushthon/network/mtprotoplainsender.py +56 -0
  102. soroushthon-0.2.21/soroushthon/network/mtprotosender.py +983 -0
  103. soroushthon-0.2.21/soroushthon/network/mtprotostate.py +285 -0
  104. soroushthon-0.2.21/soroushthon/network/requeststate.py +19 -0
  105. soroushthon-0.2.21/soroushthon/password.py +194 -0
  106. soroushthon-0.2.21/soroushthon/requestiter.py +134 -0
  107. soroushthon-0.2.21/soroushthon/sessions/__init__.py +4 -0
  108. soroushthon-0.2.21/soroushthon/sessions/abstract.py +172 -0
  109. soroushthon-0.2.21/soroushthon/sessions/memory.py +260 -0
  110. soroushthon-0.2.21/soroushthon/sessions/sqlite.py +393 -0
  111. soroushthon-0.2.21/soroushthon/sessions/string.py +72 -0
  112. soroushthon-0.2.21/soroushthon/sync.py +74 -0
  113. soroushthon-0.2.21/soroushthon/tl/__init__.py +1 -0
  114. soroushthon-0.2.21/soroushthon/tl/alltlobjects.py +1696 -0
  115. soroushthon-0.2.21/soroushthon/tl/core/__init__.py +26 -0
  116. soroushthon-0.2.21/soroushthon/tl/core/gzippacked.py +48 -0
  117. soroushthon-0.2.21/soroushthon/tl/core/messagecontainer.py +47 -0
  118. soroushthon-0.2.21/soroushthon/tl/core/rpcresult.py +35 -0
  119. soroushthon-0.2.21/soroushthon/tl/core/tlmessage.py +34 -0
  120. soroushthon-0.2.21/soroushthon/tl/custom/__init__.py +14 -0
  121. soroushthon-0.2.21/soroushthon/tl/custom/adminlogevent.py +475 -0
  122. soroushthon-0.2.21/soroushthon/tl/custom/button.py +346 -0
  123. soroushthon-0.2.21/soroushthon/tl/custom/chatgetter.py +154 -0
  124. soroushthon-0.2.21/soroushthon/tl/custom/conversation.py +529 -0
  125. soroushthon-0.2.21/soroushthon/tl/custom/dialog.py +161 -0
  126. soroushthon-0.2.21/soroushthon/tl/custom/draft.py +194 -0
  127. soroushthon-0.2.21/soroushthon/tl/custom/file.py +146 -0
  128. soroushthon-0.2.21/soroushthon/tl/custom/forward.py +51 -0
  129. soroushthon-0.2.21/soroushthon/tl/custom/inlinebuilder.py +450 -0
  130. soroushthon-0.2.21/soroushthon/tl/custom/inlineresult.py +176 -0
  131. soroushthon-0.2.21/soroushthon/tl/custom/inlineresults.py +83 -0
  132. soroushthon-0.2.21/soroushthon/tl/custom/inputsizedfile.py +9 -0
  133. soroushthon-0.2.21/soroushthon/tl/custom/message.py +1250 -0
  134. soroushthon-0.2.21/soroushthon/tl/custom/messagebutton.py +160 -0
  135. soroushthon-0.2.21/soroushthon/tl/custom/participantpermissions.py +138 -0
  136. soroushthon-0.2.21/soroushthon/tl/custom/qrlogin.py +119 -0
  137. soroushthon-0.2.21/soroushthon/tl/custom/sendergetter.py +106 -0
  138. soroushthon-0.2.21/soroushthon/tl/custom/types.py +38 -0
  139. soroushthon-0.2.21/soroushthon/tl/functions/__init__.py +452 -0
  140. soroushthon-0.2.21/soroushthon/tl/functions/account.py +1581 -0
  141. soroushthon-0.2.21/soroushthon/tl/functions/auth.py +593 -0
  142. soroushthon-0.2.21/soroushthon/tl/functions/bots.py +112 -0
  143. soroushthon-0.2.21/soroushthon/tl/functions/channels.py +1672 -0
  144. soroushthon-0.2.21/soroushthon/tl/functions/chatlists.py +325 -0
  145. soroushthon-0.2.21/soroushthon/tl/functions/conference.py +437 -0
  146. soroushthon-0.2.21/soroushthon/tl/functions/contacts.py +476 -0
  147. soroushthon-0.2.21/soroushthon/tl/functions/folders.py +44 -0
  148. soroushthon-0.2.21/soroushthon/tl/functions/help.py +259 -0
  149. soroushthon-0.2.21/soroushthon/tl/functions/langpack.py +146 -0
  150. soroushthon-0.2.21/soroushthon/tl/functions/messages.py +5469 -0
  151. soroushthon-0.2.21/soroushthon/tl/functions/payments.py +292 -0
  152. soroushthon-0.2.21/soroushthon/tl/functions/phone.py +809 -0
  153. soroushthon-0.2.21/soroushthon/tl/functions/photos.py +282 -0
  154. soroushthon-0.2.21/soroushthon/tl/functions/premium.py +152 -0
  155. soroushthon-0.2.21/soroushthon/tl/functions/stats.py +300 -0
  156. soroushthon-0.2.21/soroushthon/tl/functions/stories.py +765 -0
  157. soroushthon-0.2.21/soroushthon/tl/functions/thirdParty.py +67 -0
  158. soroushthon-0.2.21/soroushthon/tl/functions/updates.py +139 -0
  159. soroushthon-0.2.21/soroushthon/tl/functions/upload.py +168 -0
  160. soroushthon-0.2.21/soroushthon/tl/functions/users.py +170 -0
  161. soroushthon-0.2.21/soroushthon/tl/patched/__init__.py +20 -0
  162. soroushthon-0.2.21/soroushthon/tl/tlobject.py +222 -0
  163. soroushthon-0.2.21/soroushthon/tl/types/__init__.py +40015 -0
  164. soroushthon-0.2.21/soroushthon/tl/types/account.py +1096 -0
  165. soroushthon-0.2.21/soroushthon/tl/types/auth.py +809 -0
  166. soroushthon-0.2.21/soroushthon/tl/types/bots.py +43 -0
  167. soroushthon-0.2.21/soroushthon/tl/types/channels.py +232 -0
  168. soroushthon-0.2.21/soroushthon/tl/types/chatlists.py +273 -0
  169. soroushthon-0.2.21/soroushthon/tl/types/conference.py +69 -0
  170. soroushthon-0.2.21/soroushthon/tl/types/contacts.py +478 -0
  171. soroushthon-0.2.21/soroushthon/tl/types/help.py +1206 -0
  172. soroushthon-0.2.21/soroushthon/tl/types/messages.py +3000 -0
  173. soroushthon-0.2.21/soroushthon/tl/types/payments.py +633 -0
  174. soroushthon-0.2.21/soroushthon/tl/types/phone.py +313 -0
  175. soroushthon-0.2.21/soroushthon/tl/types/photos.py +135 -0
  176. soroushthon-0.2.21/soroushthon/tl/types/premium.py +209 -0
  177. soroushthon-0.2.21/soroushthon/tl/types/stats.py +368 -0
  178. soroushthon-0.2.21/soroushthon/tl/types/stickers.py +35 -0
  179. soroushthon-0.2.21/soroushthon/tl/types/storage.py +197 -0
  180. soroushthon-0.2.21/soroushthon/tl/types/stories.py +317 -0
  181. soroushthon-0.2.21/soroushthon/tl/types/thirdParty.py +94 -0
  182. soroushthon-0.2.21/soroushthon/tl/types/update.py +39 -0
  183. soroushthon-0.2.21/soroushthon/tl/types/updates.py +447 -0
  184. soroushthon-0.2.21/soroushthon/tl/types/upload.py +196 -0
  185. soroushthon-0.2.21/soroushthon/tl/types/users.py +131 -0
  186. soroushthon-0.2.21/soroushthon/types.py +1 -0
  187. soroushthon-0.2.21/soroushthon/utils.py +1577 -0
  188. soroushthon-0.2.21/soroushthon/version.py +1 -0
  189. soroushthon-0.2.21/soroushthon.egg-info/PKG-INFO +65 -0
  190. soroushthon-0.2.21/soroushthon.egg-info/SOURCES.txt +259 -0
  191. soroushthon-0.2.21/soroushthon.egg-info/dependency_links.txt +1 -0
  192. soroushthon-0.2.21/soroushthon.egg-info/requires.txt +10 -0
  193. soroushthon-0.2.21/soroushthon.egg-info/top_level.txt +2 -0
  194. soroushthon-0.2.21/soroushthon_generator/__init__.py +1 -0
  195. soroushthon-0.2.21/soroushthon_generator/data/api.tl +1638 -0
  196. soroushthon-0.2.21/soroushthon_generator/data/errors.csv +534 -0
  197. soroushthon-0.2.21/soroushthon_generator/data/friendly.csv +26 -0
  198. soroushthon-0.2.21/soroushthon_generator/data/html/404.html +44 -0
  199. soroushthon-0.2.21/soroushthon_generator/data/html/core.html +179 -0
  200. soroushthon-0.2.21/soroushthon_generator/data/html/css/docs.dark.css +185 -0
  201. soroushthon-0.2.21/soroushthon_generator/data/html/css/docs.h4x0r.css +229 -0
  202. soroushthon-0.2.21/soroushthon_generator/data/html/css/docs.light.css +182 -0
  203. soroushthon-0.2.21/soroushthon_generator/data/html/img/arrow.svg +35 -0
  204. soroushthon-0.2.21/soroushthon_generator/data/html/js/search.js +244 -0
  205. soroushthon-0.2.21/soroushthon_generator/data/methods.csv +365 -0
  206. soroushthon-0.2.21/soroushthon_generator/data/mtproto.tl +116 -0
  207. soroushthon-0.2.21/soroushthon_generator/docswriter.py +295 -0
  208. soroushthon-0.2.21/soroushthon_generator/generators/__init__.py +3 -0
  209. soroushthon-0.2.21/soroushthon_generator/generators/docs.py +649 -0
  210. soroushthon-0.2.21/soroushthon_generator/generators/errors.py +60 -0
  211. soroushthon-0.2.21/soroushthon_generator/generators/tlobject.py +720 -0
  212. soroushthon-0.2.21/soroushthon_generator/parsers/__init__.py +3 -0
  213. soroushthon-0.2.21/soroushthon_generator/parsers/errors.py +85 -0
  214. soroushthon-0.2.21/soroushthon_generator/parsers/methods.py +67 -0
  215. soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/__init__.py +3 -0
  216. soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/parser.py +148 -0
  217. soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/tlarg.py +256 -0
  218. soroushthon-0.2.21/soroushthon_generator/parsers/tlobject/tlobject.py +177 -0
  219. soroushthon-0.2.21/soroushthon_generator/sourcebuilder.py +65 -0
  220. soroushthon-0.2.21/soroushthon_generator/syncerrors.py +55 -0
  221. soroushthon-0.2.21/soroushthon_generator/utils.py +8 -0
  222. soroushthon-0.2.21/tests/__init__.py +0 -0
  223. soroushthon-0.2.21/tests/soroushthon/__init__.py +0 -0
  224. soroushthon-0.2.21/tests/soroushthon/client/__init__.py +0 -0
  225. soroushthon-0.2.21/tests/soroushthon/client/test_account_sessions.py +21 -0
  226. soroushthon-0.2.21/tests/soroushthon/client/test_delete_messages.py +35 -0
  227. soroushthon-0.2.21/tests/soroushthon/client/test_drafts.py +24 -0
  228. soroushthon-0.2.21/tests/soroushthon/client/test_entity_cache.py +58 -0
  229. soroushthon-0.2.21/tests/soroushthon/client/test_interactions.py +138 -0
  230. soroushthon-0.2.21/tests/soroushthon/client/test_media_connection.py +266 -0
  231. soroushthon-0.2.21/tests/soroushthon/client/test_messages.py +84 -0
  232. soroushthon-0.2.21/tests/soroushthon/client/test_profiles.py +193 -0
  233. soroushthon-0.2.21/tests/soroushthon/client/test_read_acknowledge.py +40 -0
  234. soroushthon-0.2.21/tests/soroushthon/client/test_shortcuts.py +31 -0
  235. soroushthon-0.2.21/tests/soroushthon/client/test_unsupported_features.py +56 -0
  236. soroushthon-0.2.21/tests/soroushthon/crypto/__init__.py +0 -0
  237. soroushthon-0.2.21/tests/soroushthon/crypto/test_rsa.py +45 -0
  238. soroushthon-0.2.21/tests/soroushthon/events/__init__.py +0 -0
  239. soroushthon-0.2.21/tests/soroushthon/events/test_chataction.py +68 -0
  240. soroushthon-0.2.21/tests/soroushthon/events/test_dispatch.py +71 -0
  241. soroushthon-0.2.21/tests/soroushthon/events/test_registration.py +47 -0
  242. soroushthon-0.2.21/tests/soroushthon/extensions/__init__.py +0 -0
  243. soroushthon-0.2.21/tests/soroushthon/extensions/test_html.py +81 -0
  244. soroushthon-0.2.21/tests/soroushthon/extensions/test_markdown.py +80 -0
  245. soroushthon-0.2.21/tests/soroushthon/test_coverage_runner.py +138 -0
  246. soroushthon-0.2.21/tests/soroushthon/test_event_coverage_diagnostics.py +59 -0
  247. soroushthon-0.2.21/tests/soroushthon/test_helpers.py +83 -0
  248. soroushthon-0.2.21/tests/soroushthon/test_interactive_coverage.py +67 -0
  249. soroushthon-0.2.21/tests/soroushthon/test_media_attributes.py +48 -0
  250. soroushthon-0.2.21/tests/soroushthon/test_media_coverage.py +53 -0
  251. soroushthon-0.2.21/tests/soroushthon/test_multipart_coverage.py +149 -0
  252. soroushthon-0.2.21/tests/soroushthon/test_pickle.py +35 -0
  253. soroushthon-0.2.21/tests/soroushthon/test_sessions.py +51 -0
  254. soroushthon-0.2.21/tests/soroushthon/test_utils.py +82 -0
  255. soroushthon-0.2.21/tests/soroushthon/test_websocket.py +220 -0
  256. soroushthon-0.2.21/tests/soroushthon/tl/__init__.py +0 -0
  257. soroushthon-0.2.21/tests/soroushthon/tl/test_serialization.py +13 -0
  258. soroushthon-0.2.21/tools/audit_upstreams.py +133 -0
  259. soroushthon-0.2.21/tools/build_capability_inventory.py +120 -0
  260. soroushthon-0.2.21/tools/check_release.py +84 -0
  261. soroushthon-0.2.21/tools/generate.py +157 -0
@@ -0,0 +1,27 @@
1
+ name: Check Python package
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test-and-build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: actions/setup-python@v5
17
+ with:
18
+ python-version: '3.12'
19
+ - name: Install test and build tools
20
+ run: python -m pip install -e '.[test]' build twine
21
+ - name: Test
22
+ run: python -m pytest -q
23
+ - name: Build and check metadata
24
+ run: |
25
+ python -m build
26
+ python -m twine check dist/*
27
+ python tools/check_release.py dist
@@ -0,0 +1,81 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ dist-*/
11
+ downloads/
12
+ eggs/
13
+ .eggs/
14
+ lib/
15
+ lib64/
16
+ parts/
17
+ sdist/
18
+ var/
19
+ wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ *.pyi
24
+
25
+ # Virtual Environment
26
+ venv/
27
+ .venv/
28
+ env/
29
+ ENV/
30
+
31
+ # Package managers
32
+ poetry.lock
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+
36
+ # Linting / Type checking
37
+ .mypy_cache/
38
+ .ruff_cache/
39
+
40
+ # Environment variables
41
+ .env
42
+ .env.*
43
+ .pypirc
44
+
45
+ # Testing
46
+ .pytest_cache/
47
+ .coverage
48
+ htmlcov/
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+
54
+ # IDE
55
+ .vscode/
56
+ .idea/
57
+ *.swp
58
+ *.swo
59
+ *~
60
+
61
+ # OS
62
+ .DS_Store
63
+ Thumbs.db
64
+
65
+ # Documentation
66
+ docs/site/
67
+
68
+ # Testing scripts
69
+ speedtest.py
70
+ test.py
71
+
72
+ *.session
73
+ *.session-journal
74
+ *.session-*
75
+ pytest-of-root/
76
+ pip-ephem-wheel-cache-*/
77
+ pip-unpack-*/
78
+ readthedocs/
79
+ .readthedocs.yaml
80
+ tests/readthedocs/
81
+ .mimocode/
@@ -0,0 +1,92 @@
1
+ # گزارش بررسی معماری Soroushthon، SPlusthon و Telethon
2
+
3
+ این گزارش برای ساخت یک **کتابخانهٔ عمومی حساب کاربری** است. هیچ بخش آن به ربات مدیریت گروه وابسته نیست. نسخهٔ مبنا: SPlusthon در commit `cad975488c66f91e4548c7fd4c255b4f787f9b0e`؛ مرجع مقایسه: شاخهٔ v1 کتابخانهٔ Telethon در commit `dab6bc4d4fc0c7815f6f19c6f643d9f75d2d930c`. مقایسه و آزمون‌های این گزارش در ۲۷ سپتامبر ۲۰۲۶ انجام شده‌اند. این بررسی جایگزین آزمایش همهٔ قابلیت‌ها روی سرور زندهٔ سروش نیست.
4
+
5
+ ## Telethon چه چیزی را فراهم می‌کند؟
6
+
7
+ Telethon چند لایه دارد: تعریف‌های [زبان TL](https://docs.telethon.dev/en/stable/developing/understanding-the-type-language.html) برای ساخت کلاس‌های درخواست و پاسخ؛ موتور شبکه، رمزنگاری و نشست؛ و متدهای ساده‌تر کلاینت. مولد، تعریف‌های TL را به کلاس‌های پایتون تبدیل می‌کند و کلاس‌های `*Methods` رابط کاربردی هستند. [ساختار پروژهٔ Telethon](https://docs.telethon.dev/en/stable/developing/project-structure.html) و [راهنمای Raw API](https://docs.telethon.dev/en/stable/concepts/full-api.html) این تفکیک را توضیح می‌دهند. SPlusthon این لایه‌ها را از Telethon گرفته و طرح TL، WebSocket، کلیدها و پیش‌فرض‌های اتصال را برای سروش تغییر داده است. از روی کد هیچ شاهدی برای «نفوذ به سرور» به دست نمی‌آید؛ منشأ دقیق همهٔ تعریف‌های TL را نیز نمی‌توان با مشاهدهٔ مخزن تعیین کرد.
8
+
9
+ کپی کردن متدهای Telethon به‌تنهایی کافی نیست: درخواست خام باید در طرح **خود سروش** وجود داشته باشد، شناسه و امضایش مطابق سرور باشد و پاسخ و خطا واقعاً آزموده شوند. تفاوت لایهٔ طرح تلگرام و سروش دلیل کافی برای نتیجه‌گیری دربارهٔ پشتیبانی سرور از هر درخواست منفرد نیست.
10
+
11
+ ## دامنهٔ قابلیت‌های خود سروش
12
+
13
+ [وب‌سایت رسمی سروش‌پلاس](https://sapp.ir/) گفتگوی شخصی و گروهی، کانال، فایل، فضای ذخیره‌سازی و تماس صوتی/تصویری را معرفی می‌کند. در طرح TL فعلی بسته نام‌های مربوط به پیام، حساب، کانال، تماس، کنفرانس، داستان، پرداخت و سایر حوزه‌ها دیده می‌شود (شمارش هر حوزه در `CAPABILITIES.md`). این دو مشاهده **به‌تنهایی** اثبات نمی‌کنند که تمام امکانات برنامه با همین WebSocket و یک حساب، یا با یک فراخوانی TL، قابل پیاده‌سازی هستند. برای تماس زنده، پرداخت و امکانات تازه ممکن است جریان‌ها و سرویس‌های دیگری نیز لازم باشد. در منابع عمومی بررسی‌شده، مرجع معتبر و کاملِ شناسه و امضای همهٔ درخواست‌های حساب کاربریِ سروش به دست نیامد؛ بنابراین درخواست‌های غایب را با شناسهٔ تلگرام پر نکرده‌ایم.
14
+
15
+ ## نتیجهٔ قابل تکرارِ مقایسهٔ کل طرح
16
+
17
+ در ریشهٔ پروژه، کنار یک checkout از Telethon v1، اجرا کن:
18
+
19
+ ```sh
20
+ python tools/audit_upstreams.py --telethon ../telethon_reference
21
+ ```
22
+
23
+ | گروه | SPlusthon/Soroushthon | Telethon v1 | نام مشترک | شناسهٔ یکسان | تعریف کاملاً یکسان | فقط سروش | فقط Telethon |
24
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
25
+ | نوع‌های TL | ۱۲۷۰ | ۱۵۴۱ | ۱۲۲۵ | ۱۱۲۱ | ۱۱۱۱ | ۴۵ | ۳۱۶ |
26
+ | تابع‌های TL | ۳۶۶ | ۷۵۴ | ۳۳۶ | ۳۰۲ | ۲۹۶ | ۳۰ | ۴۱۸ |
27
+
28
+ طرح بستهٔ سروش `LAYER 182` و طرح checkout تلگرام `LAYER 222` است. این شمارش فقط تعریف‌های یک‌خطی معتبر در دو فایل `api.tl` را مقایسه می‌کند. برای مثال بعضی سازنده‌ها با نام مشترک، شناسه یا امضای متفاوت دارند؛ `messages.deleteMessages` از این دسته است. انتقال خودکار درخواست‌های غایب Telethon به سروش اشتباه است.
29
+
30
+ در کلاس‌های `*Methods`، ۵۹ نام عمومی Telethon در فورک هم یافت شد و پنج نام دیگر برای پروفایل در Soroushthon وجود دارد؛ **اشتراک نام به معنی کارکرد ۵۹ قابلیت نیست**. بررسی اولیه ۱۲ نام کلاس خامِ غایب یافت؛ پس از حذف استفادهٔ نامعتبر `InvokeWithoutUpdatesRequest` در 0.2.13، ۱۱ نام در ارجاع‌های کد باقی‌اند و شاخه‌های عمومی وابسته به آن‌ها خطای مشخص می‌دهند. مسیر پیش‌نویس‌های همهٔ گفتگوها از ارجاع به درخواست غایب به بازیابی از فهرست گفتگوها تغییر کرده است؛ این تغییر هنوز روی سرور زنده آزموده نشده است.
31
+
32
+ ## درخواست‌های غایب و اثرشان
33
+
34
+ | حوزه | نام‌های غایب در طرحِ بسته | مسیر استفادهٔ احتمالی |
35
+ | --- | --- | --- |
36
+ | ورود ربات | `auth.ImportBotAuthorizationRequest` | شاخهٔ `sign_in(bot_token=...)`؛ اکنون پیام واضح `NotImplementedError` می‌دهد |
37
+ | نشست takeout | `account.InitTakeoutSessionRequest`, `account.FinishTakeoutSessionRequest`, `InvokeWithTakeoutRequest` | آغاز، درخواست درون نشست، پایان |
38
+ | بدون رویداد | `InvokeWithoutUpdatesRequest` | گزینهٔ `receive_updates=False` و مسیر ارسال درخواست |
39
+ | گفتگو و رسانه | `messages.EditInlineBotMessageRequest`, `upload.GetCdnFileRequest`, `upload.ReuploadCdnFileRequest` | ویرایش inline، مسیر CDN؛ پیش‌نویس‌ها اکنون مسیر جایگزین دارند |
40
+ | مدیریت و پوشه‌ها | `channels.GetAdminLogRequest`, `messages.EditChatAdminRequest`, `folders.DeleteFolderRequest` | مسیرهای متناظر متدهای سطح‌بالا |
41
+ | پیکربندی CDN | `help.GetCdnConfigRequest` | مسیر دریافت کلید/پیکربندی CDN |
42
+
43
+ این‌ها ارجاع‌های **ایستا** هستند. بعضی فقط در یک شاخهٔ شرطی یا برای نوع خاصی از ورودی اجرا می‌شوند. وجودشان به معنای خراب بودن تمام تابع `send_file` یا `sign_in` نیست؛ برای نمونه ورود با شمارهٔ تلفن قبلاً روی گوشی اجرا شده، ولی ورود با توکن ربات در طرح فعلی تعریف نشده است. بدون تعریف تأییدشدهٔ سروش، ساختن کلاس TL با شناسهٔ تلگرام راه‌حل معتبر نیست.
44
+
45
+ ## مرور لایه‌ها
46
+
47
+ | لایه | شواهد در کد | وضعیت/کار بعدی |
48
+ | --- | --- | --- |
49
+ | اتصال و رمزنگاری | `network/connection/websocket.py`، `network/mtprotosender.py`، `crypto/`، `client/telegrambaseclient.py` | WebSocket پیش‌فرض سروش به مسیر `/apiws` می‌رود. گزینه‌های proxy و local_addr در این مسیر اعمال نمی‌شدند؛ اکنون به‌جای اتصال مستقیم ناخواسته، خطای صریح می‌دهند. پایداری اتصال طولانی و مسیرهای جایگزین نیازمند آزمون زنده‌اند. |
50
+ | نشست و بازیابی | `sessions/memory.py`، `sessions/sqlite.py`، `sessions/string.py` | خطای setter کلید موقت و ترتیب بازیابی ستون‌های SQLite اصلاح شد؛ حفظ مقدارها بعد از بستن و بازکردن با آزمون محلی بررسی شد. بازیابی نشست واقعی پس از قطعی طولانی نیازمند آزمون گوشی است. |
51
+ | احراز هویت | `client/auth.py` و `tl/functions/auth.py` | ورود با شماره/کد در نسخه‌های قبلی توسط کاربر اجرا شده است. مسیر bot-token کلاس خام ندارد؛ بعضی متن‌های مستنداتِ منتقل‌شده از تلگرام هنوز باید بازبینی شوند. |
52
+ | موجودیت‌ها و آدرس‌دهی | `client/users.py`، `sessions/`، `utils.py` | پردازش موجودیت‌ها اکنون قبل از برگشت RPC منتظر می‌ماند؛ تبدیل لینک عمومی و دریافت بیوی خود/کاربر دیگر روی گوشی گزارش شده‌اند. |
53
+ | پیام، گفتگو و رویداد | `client/messages.py`، `client/dialogs.py`، `client/updates.py`، `events/` | کاربر خواندن سه گفتگو و سه پیام از تاریخچه را روی گوشی تأیید کرد. مسیر همهٔ پیش‌نویس‌ها از گفتگوها بازسازی شده و آزمون محلی دارد. برای حذف پیام، اگر مقصد داده شده باشد، اکنون فیلد `peer` طرح سروش فرستاده می‌شود. دریافت رویداد، پیش‌نویس، ویرایش، حذف و شاخه‌های پیشرفته هنوز نیازمند آزمون زنده‌اند. |
54
+ | فایل و رسانه | `client/uploads.py`، `client/downloads.py`، `tl/custom/` | کد سطح‌بالا موجود است؛ شاخه‌های CDN به کلاس‌های غایب اشاره می‌کنند. آپلود/دانلود عادی، انواع فایل و انقضا نیازمند آزمون واقعی و گزارش خطا هستند. |
55
+ | تولید کد TL | `soroushthon_generator/data/api.tl`، `tools/generate.py` | مولد و ۳۶۶ تعریف درخواست بسته شده‌اند. برای هر قابلیت تازه باید ابتدا تعریف معتبر همان سرویس به دست آید، بعد کلاس تولید و درخواست/پاسخ آزموده شود. |
56
+ | ابزار و آزمون | `tests/`، `tools/audit_upstreams.py` | آزمون‌های محلی مسیرهای مشخص هسته را می‌سنجند؛ آزمون خودکار محلی نمی‌تواند پشتیبانی سرور را ثابت کند. |
57
+
58
+ نسخهٔ 0.2.4 متد `SoroushClient.for_account('test')` را برای نشست مستقلِ حساب آزمایشی اضافه کرده است. نام `main` به فایل نشست قدیمی اشاره می‌کند؛ نام‌های دیگر فایل جدا در پوشهٔ خانگی می‌سازند. آزمون رسانه در `examples/media_coverage.py` برای پنج قالب کوچک، مراحل ارسال، بازیابی، دانلود و حذف پیام تازهٔ همان حساب را ثبت می‌کند. مسیر ساخت محلیِ عکس، ویدئو، صوت و سند آزمایش شده است. شرح نتیجهٔ سرور در `MEDIA.md` آمده است.
59
+
60
+ آزمون زندهٔ حساب دوم در نسخهٔ 0.2.4 نشان داد ارسال متن، ویرایش و حذف پیام تازه موفق‌اند، ولی پنج بار `upload.SaveFilePartRequest` و یک بار `upload.GetFileRequest` با `FILE_REQUEST_RECEIVED_ON_CONNECTION_SERVER` رد شدند. نسخهٔ 0.2.5 اتصال مستقل و `InitConnection(params.connection=upload)` را روی همان میزبان عمومی امتحان کرد؛ نتیجهٔ زندهٔ هر پنج آپلود همچنان خطای ۴۲۲ بود. این روش رد شده است. بررسی [بستهٔ وب رسمی](https://web.splus.ir/main.69cb2ff17c22724308b0.js) نشان داد sender فایل به میزبان جایگزین DC متصل می‌شود و RPC فایل را مستقیم می‌فرستد. نسخهٔ 0.2.6 مسیر آپلود و دانلود را بر این اساس عوض کرده است. آزمون‌های محلی مسیریابی، درخواست خام، کلید DC دیگر و بستن اتصال را بررسی کرده‌اند. جدول دقیق میزبان‌ها در [PROTOCOL.md](PROTOCOL.md) آمده است.
61
+
62
+ پس از انتشار 0.2.6، کاربر روی حساب آزمایشی `70012182` برای هر پنج قالب کوچک، ارسال، بازیابی، دانلود و حذف را موفق گزارش کرد. مجموعاً ۲۰ مرحلهٔ `PASS` ثبت شد. این نتیجه، مسیر رسانه را برای همین حساب و همین اندازه‌ها تأیید می‌کند؛ اندازهٔ نمونه‌ها کمتر از ۱۰ کیلوبایت است و شاخهٔ چندبخشی و `SaveBigFilePart` را پوشش نمی‌دهد. نسخهٔ 0.2.7 آزمون جداگانهٔ سند حدود ۲ مگابایتی و مسیر اختیاری بالای ۱۰ مگابایت با بررسی تطابق بایت‌ها اضافه می‌کند. دانلود عکس پروفایل و انتقال فایل از DC متفاوت همچنان نیازمند آزمون زنده‌اند.
63
+
64
+ اجرای زندهٔ نخست آزمون ۲ مگابایتی در نسخهٔ 0.2.7 با `TimeoutError` در ارسال شکست خورد؛ اتصال WebSocket چند بار timeout شد و یک `aiohttp.ClientSession` باز ماند. تعداد بخش‌های پذیرفته‌شده در خروجی معلوم نبود، بنابراین این مشاهده به‌تنهایی مشکل سرور یا محدودیت اندازهٔ فایل را ثابت نمی‌کند. نسخهٔ 0.2.8 نشست را هنگام لغو/شکست handshake و راه‌اندازی WebSocket می‌بندد و آزمون تشخیصی دو بخشی با شمارش زندهٔ بخش‌ها اضافه می‌کند. علت اصلی timeout همچنان نیازمند گزارش شمارش بخش‌ها و آزمون شبکهٔ حساب آزمایشی است.
65
+
66
+ گزارش 0.2.7 بعداً نشان داد ۵ بخش از ۱۷ بخش پذیرفته شدند؛ اجرای زندهٔ `--probe` در 0.2.8 با دو بخش، بازیابی و تطابق کامل بایت‌ها موفق بود. در آزمون 0.2.7 `asyncio.wait_for(send_file, timeout=180)` سقف را روی کل ارسال گذاشته بود. نسخهٔ 0.2.9 آن را به وقفهٔ بدون پیشرفت تغییر می‌دهد و زمان تأیید هر بخش را گزارش می‌کند تا کندی CPU/شبکه از خطای سرور جدا شود. هنوز آزمون زندهٔ دوبارهٔ فایل ۲ مگابایتی انجام نشده است.
67
+
68
+ آزمون زندهٔ 0.2.9 روی حساب دوم هر ۱۷ بخش فایل `2097169` بایتی را در حدود ۹۱ ثانیه آپلود کرد و پیام را بازیافت و حذف کرد. دانلود در **اولین** `GetFileRequest` با `ServerError` ۵۰۰ شکست خورد؛ شمار بخش‌های دریافتی صفر و زمان خطا ۰٫۴ ثانیه بود. کلاینت وب رسمی برای این اندازه درخواست ۱۲۸ کیلوبایتی دارد و خطای داخلی فایل را چند بار تکرار می‌کند. مسیر نخستین فایل در 0.2.9 مستقیم با `sender.send` می‌رفت و برخلاف درخواست‌های بعدی، حلقهٔ retry نداشت. نسخهٔ 0.2.10 حداکثر سه تکرار محدود برای `ServerError` در درخواست نخست اضافه کرد. آزمون زندهٔ 0.2.10 روی همان حساب، ارسال، بازیابی، دریافت ۱۷ بخش، تطابق کامل محتوا و حذف سند را تأیید کرد. از گزارش نمی‌توان فهمید در آن اجرای موفق، retry لازم شده بود یا نه.
69
+
70
+ کد وب رسمی برای آپلود بر حسب اندازهٔ فایل، بخش ۳۲/۲۵۶/۵۱۲ کیلوبایتی به کار می‌برد؛ کد قبلی کتابخانه تا ۱۰۰ مگابایت همیشه ۱۲۸ کیلوبایت انتخاب می‌کرد. در 0.2.11 اندازهٔ پیش‌فرض آپلود با این رفتار هماهنگ شد و آزمون محلی ۲ مگابایت + ۱۷ بایت (۹ بخش کوچک) و ۱۰ مگابایت + ۱ کیلوبایت (۲۱ بخش بزرگ) افزوده شد. نتیجهٔ آزمون زندهٔ بعدی در بند زیر ثبت شده است.
71
+
72
+ آزمون زندهٔ 0.2.11 آپلود ۹ بخشی و دانلود ۱۷ بخشی سند ۲ مگابایتی را با تطابق محتوا تأیید کرد. سند بالای ۱۰ مگابایت نیز در ۲۱ بخش ارسال و پیام آن بازیافت شد. دانلود پس از دریافت ۱۶ بخش به سقف ۹۰ ثانیهٔ کل دانلود برخورد؛ آن سقف در ابزار آزمون بود. نسخهٔ 0.2.12 سقف را برای هر وقفهٔ بدون دریافت بخش جداگانه می‌سنجد و امکان نگهداری پیام پس از شکست و تلاش دوبارهٔ دانلود با هش ثبت‌شده را به ابزار آزمون افزود. دریافت و تطابق کامل سند بزرگ هنوز روی سرور تأیید نشده است.
73
+
74
+ در 0.2.13 تمام ۵۹ نام متد Telethon v1 با رابط بسته و تعریف‌های خامِ SPlusthon مقایسه شدند؛ جدول تفکیک آزمون زنده، مسیر غیرمستقیم، آزمون محلی و شاخهٔ مسدود در `PARITY.md` است. بررسی دوبارهٔ ارجاع‌های خام، ۱۱ نام کلاس غایب را در کد به‌جا نشان می‌دهد. مسیرهای takeout، گزارش مدیران، unpack پوشه، ویرایش مدیر گروه کوچک، ویرایش پیام inline، CDN redirect و خاموش‌کردن رویداد، در نبود طرح سروش خطای روشن می‌دهند؛ اصلاح درصد پیشرفت `action` برای فایل نیز آزمون محلی دارد. این تغییرها به معنی اجرای موفق شاخه‌های مسدود روی سرور نیستند.
75
+
76
+ ## تغییرهای عملی این مرحله
77
+
78
+ 1. پردازش موجودیت‌های RPC تک‌درخواستی و دسته‌ای قبل از بازگشت پاسخ انجام می‌شود؛ مصرف‌کننده فوراً به موجودیت‌های ذخیره‌شده دسترسی دارد.
79
+ 2. کلید موقت نشست از کلید اصلی جدا می‌ماند و SQLite ترتیب ستون‌های ذخیره‌شده را درست بازمی‌خواند؛ نشست‌های قدیمی با کلید موقت خالی هم پوشش داده می‌شوند.
80
+ 3. WebSocket گزینهٔ proxy/local_addr را دیگر بی‌صدا نادیده نمی‌گیرد؛ پشتیبانی واقعی این گزینه‌ها هنوز باید پیاده‌سازی شود.
81
+ 4. مسیر ورود با توکن ربات به جای خطای مبهم AttributeError دلیل روشن می‌دهد.
82
+ 5. اسکریپت بررسی مستقل برای مقایسهٔ تمام تعریف‌های TL و کشف ارجاع‌های خام غایب اضافه شد.
83
+ 6. فهرست ماشینی ۶۴ متد عمومی و ۳۶۶ درخواست خام در `CAPABILITIES.json` و مرور آن در `CAPABILITIES.md` تولید شد؛ `examples/coverage.py` در یک اجرا برای همهٔ متدهای عمومی نتیجهٔ `PASS`، `FAIL` یا `SKIP` ثبت می‌کند. `SKIP` با `PASS` یکسان نیست و نبود دادهٔ آزمایشی را پنهان نمی‌کند.
84
+
85
+ ## ترتیب کار برای رسیدن به کتابخانهٔ قوی
86
+
87
+ 1. برای هر قابلیت، نمونهٔ ورودی/پاسخ **بدون شماره، کد ورود یا فایل نشست** تهیه و نسخهٔ کلاینت رسمی/طرح متناظر را مشخص کن. از حساب آزمایشی خودت استفاده کن.
88
+ 2. ابتدا مسیرهای پرکاربرد کتابخانه را روی گوشی در سناریوهای کوچک بیازما: ورود دوباره، فهرست گفتگو، دریافت رویداد، ارسال/ویرایش/حذف پیام خود، آپلود/دانلود فایل. نتیجهٔ هر مسیر را با خطا و نوع پاسخ ثبت کن.
89
+ 3. اگر کلاس خام موجود است، ناسازگاری تبدیل ورودی/پاسخ را در متد سطح‌بالا اصلاح کن. اگر نیست، فقط با شناسه و امضای معتبر سروش آن را به `api.tl` اضافه و مولد را اجرا کن.
90
+ 4. برای هر اصلاح مسیر موفق، خطا، نشست و اتصال مجدد را جداگانه آزمایش کن. یک جدول پوشش بر اساس **رفتار واقعی** نگهدار؛ تعداد نام متدها معیار پوشش نیست.
91
+
92
+ هیچ کلید نشست، شماره یا کد تأییدی را برای بررسی این پروژه منتشر نکن. گزارش خطا با نوع درخواست و متن پاک‌سازی‌شده کافی است.