spluspy 2.0.4__tar.gz → 2.0.6__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 (314) hide show
  1. spluspy-2.0.6/.gitignore +50 -0
  2. {spluspy-2.0.4 → spluspy-2.0.6}/CHANGELOG.md +25 -0
  3. {spluspy-2.0.4 → spluspy-2.0.6}/Dockerfile +3 -2
  4. {spluspy-2.0.4 → spluspy-2.0.6}/MANIFEST.in +1 -1
  5. {spluspy-2.0.4 → spluspy-2.0.6}/PKG-INFO +6 -3
  6. {spluspy-2.0.4 → spluspy-2.0.6}/README.md +3 -2
  7. {spluspy-2.0.4 → spluspy-2.0.6}/examples/01_hello_bot.py +1 -2
  8. {spluspy-2.0.4 → spluspy-2.0.6}/examples/02_echo_bot.py +1 -1
  9. {spluspy-2.0.4 → spluspy-2.0.6}/examples/04_private_only.py +3 -4
  10. {spluspy-2.0.4 → spluspy-2.0.6}/examples/05_group_only.py +3 -4
  11. {spluspy-2.0.4 → spluspy-2.0.6}/examples/06_regex_bot.py +6 -7
  12. {spluspy-2.0.4 → spluspy-2.0.6}/examples/07_user_filter.py +5 -6
  13. {spluspy-2.0.4 → spluspy-2.0.6}/examples/09_inline_keyboard.py +8 -9
  14. {spluspy-2.0.4 → spluspy-2.0.6}/examples/10_reply_keyboard.py +7 -8
  15. {spluspy-2.0.4 → spluspy-2.0.6}/examples/11_message_actions.py +10 -12
  16. spluspy-2.0.6/examples/12_media_bot.py +36 -0
  17. {spluspy-2.0.4 → spluspy-2.0.6}/examples/13_fsm_bot.py +12 -13
  18. {spluspy-2.0.4 → spluspy-2.0.6}/examples/14_plugin_bot.py +7 -5
  19. {spluspy-2.0.4 → spluspy-2.0.6}/examples/15_middleware_bot.py +2 -2
  20. {spluspy-2.0.4 → spluspy-2.0.6}/pyproject.toml +2 -1
  21. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/__init__.py +17 -0
  22. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/__version__.py +1 -1
  23. spluspy-2.0.6/spluspy/admin.py +285 -0
  24. spluspy-2.0.6/spluspy/afk.py +202 -0
  25. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/client/client.py +2403 -1467
  26. spluspy-2.0.6/spluspy/compat.py +50 -0
  27. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/config.py +3 -3
  28. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/base.py +6 -14
  29. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/filters/__init__.py +2 -0
  30. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/filters/filters.py +38 -20
  31. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/fsm/state.py +9 -0
  32. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/middleware/base.py +121 -101
  33. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/middleware/rate_limit.py +6 -1
  34. spluspy-2.0.6/spluspy/mirror.py +207 -0
  35. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/bot.py +8 -44
  36. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/chat.py +4 -4
  37. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/media.py +11 -11
  38. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/message.py +15 -80
  39. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/objects.py +6 -6
  40. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/user.py +1 -1
  41. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/__init__.py +5 -0
  42. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/client.py +483 -396
  43. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/connection.py +167 -167
  44. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/mtproto.py +41 -0
  45. spluspy-2.0.6/spluspy/network/protocols.py +104 -0
  46. spluspy-2.0.6/spluspy/network/spluspy_adapter.py +343 -0
  47. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/telethon_adapter.py +155 -153
  48. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/transport.py +32 -62
  49. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/plugins/loader.py +150 -150
  50. spluspy-2.0.6/spluspy/py.typed +0 -0
  51. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/scheduler/__init__.py +2 -2
  52. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/scheduler/scheduler.py +140 -2
  53. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/session/sqlite.py +10 -13
  54. spluspy-2.0.6/spluspy/spluspy2/__init__.py +13 -0
  55. spluspy-2.0.6/spluspy/spluspy2/_updates/__init__.py +3 -0
  56. spluspy-2.0.6/spluspy/spluspy2/_updates/entitycache.py +59 -0
  57. spluspy-2.0.6/spluspy/spluspy2/_updates/messagebox.py +830 -0
  58. spluspy-2.0.6/spluspy/spluspy2/_updates/session.py +195 -0
  59. spluspy-2.0.6/spluspy/spluspy2/client/__init__.py +25 -0
  60. spluspy-2.0.6/spluspy/spluspy2/client/account.py +247 -0
  61. spluspy-2.0.6/spluspy/spluspy2/client/auth.py +740 -0
  62. spluspy-2.0.6/spluspy/spluspy2/client/bots.py +72 -0
  63. spluspy-2.0.6/spluspy/spluspy2/client/buttons.py +101 -0
  64. spluspy-2.0.6/spluspy/spluspy2/client/chats.py +1339 -0
  65. spluspy-2.0.6/spluspy/spluspy2/client/dialogs.py +614 -0
  66. spluspy-2.0.6/spluspy/spluspy2/client/downloads.py +1096 -0
  67. spluspy-2.0.6/spluspy/spluspy2/client/messageparse.py +233 -0
  68. spluspy-2.0.6/spluspy/spluspy2/client/messages.py +1528 -0
  69. spluspy-2.0.6/spluspy/spluspy2/client/soroushclient.py +13 -0
  70. spluspy-2.0.6/spluspy/spluspy2/client/telegrambaseclient.py +1016 -0
  71. spluspy-2.0.6/spluspy/spluspy2/client/updates.py +777 -0
  72. spluspy-2.0.6/spluspy/spluspy2/client/uploads.py +867 -0
  73. spluspy-2.0.6/spluspy/spluspy2/client/users.py +631 -0
  74. spluspy-2.0.6/spluspy/spluspy2/crypto/__init__.py +10 -0
  75. spluspy-2.0.6/spluspy/spluspy2/crypto/aes.py +111 -0
  76. spluspy-2.0.6/spluspy/spluspy2/crypto/aesctr.py +42 -0
  77. spluspy-2.0.6/spluspy/spluspy2/crypto/authkey.py +63 -0
  78. spluspy-2.0.6/spluspy/spluspy2/crypto/cdndecrypter.py +109 -0
  79. spluspy-2.0.6/spluspy/spluspy2/crypto/factorization.py +67 -0
  80. spluspy-2.0.6/spluspy/spluspy2/crypto/libssl.py +138 -0
  81. spluspy-2.0.6/spluspy/spluspy2/crypto/rsa.py +268 -0
  82. spluspy-2.0.6/spluspy/spluspy2/custom.py +1 -0
  83. spluspy-2.0.6/spluspy/spluspy2/errors/__init__.py +46 -0
  84. spluspy-2.0.6/spluspy/spluspy2/errors/common.py +180 -0
  85. spluspy-2.0.6/spluspy/spluspy2/errors/rpcbaseerrors.py +135 -0
  86. spluspy-2.0.6/spluspy/spluspy2/errors/rpcerrorlist.py +5356 -0
  87. spluspy-2.0.6/spluspy/spluspy2/events/__init__.py +140 -0
  88. spluspy-2.0.6/spluspy/spluspy2/events/album.py +345 -0
  89. spluspy-2.0.6/spluspy/spluspy2/events/callbackquery.py +345 -0
  90. spluspy-2.0.6/spluspy/spluspy2/events/chataction.py +458 -0
  91. spluspy-2.0.6/spluspy/spluspy2/events/common.py +186 -0
  92. spluspy-2.0.6/spluspy/spluspy2/events/inlinequery.py +247 -0
  93. spluspy-2.0.6/spluspy/spluspy2/events/messagedeleted.py +57 -0
  94. spluspy-2.0.6/spluspy/spluspy2/events/messageedited.py +52 -0
  95. spluspy-2.0.6/spluspy/spluspy2/events/messageread.py +143 -0
  96. spluspy-2.0.6/spluspy/spluspy2/events/newmessage.py +223 -0
  97. spluspy-2.0.6/spluspy/spluspy2/events/raw.py +53 -0
  98. spluspy-2.0.6/spluspy/spluspy2/events/userupdate.py +310 -0
  99. spluspy-2.0.6/spluspy/spluspy2/extensions/__init__.py +6 -0
  100. spluspy-2.0.6/spluspy/spluspy2/extensions/binaryreader.py +210 -0
  101. spluspy-2.0.6/spluspy/spluspy2/extensions/html.py +208 -0
  102. spluspy-2.0.6/spluspy/spluspy2/extensions/markdown.py +193 -0
  103. spluspy-2.0.6/spluspy/spluspy2/extensions/messagepacker.py +122 -0
  104. spluspy-2.0.6/spluspy/spluspy2/functions.py +1 -0
  105. spluspy-2.0.6/spluspy/spluspy2/helpers.py +434 -0
  106. spluspy-2.0.6/spluspy/spluspy2/hints.py +72 -0
  107. spluspy-2.0.6/spluspy/spluspy2/network/__init__.py +14 -0
  108. spluspy-2.0.6/spluspy/spluspy2/network/authenticator.py +212 -0
  109. spluspy-2.0.6/spluspy/spluspy2/network/connection/__init__.py +13 -0
  110. spluspy-2.0.6/spluspy/spluspy2/network/connection/connection.py +455 -0
  111. spluspy-2.0.6/spluspy/spluspy2/network/connection/http.py +39 -0
  112. spluspy-2.0.6/spluspy/spluspy2/network/connection/tcpabridged.py +33 -0
  113. spluspy-2.0.6/spluspy/spluspy2/network/connection/tcpfull.py +58 -0
  114. spluspy-2.0.6/spluspy/spluspy2/network/connection/tcpintermediate.py +46 -0
  115. spluspy-2.0.6/spluspy/spluspy2/network/connection/tcpmtproxy.py +165 -0
  116. spluspy-2.0.6/spluspy/spluspy2/network/connection/tcpobfuscated.py +62 -0
  117. spluspy-2.0.6/spluspy/spluspy2/network/connection/websocket.py +387 -0
  118. spluspy-2.0.6/spluspy/spluspy2/network/mtprotoplainsender.py +56 -0
  119. spluspy-2.0.6/spluspy/spluspy2/network/mtprotosender.py +979 -0
  120. spluspy-2.0.6/spluspy/spluspy2/network/mtprotostate.py +285 -0
  121. spluspy-2.0.6/spluspy/spluspy2/network/requeststate.py +19 -0
  122. spluspy-2.0.6/spluspy/spluspy2/password.py +194 -0
  123. spluspy-2.0.6/spluspy/spluspy2/requestiter.py +134 -0
  124. spluspy-2.0.6/spluspy/spluspy2/sessions/__init__.py +4 -0
  125. spluspy-2.0.6/spluspy/spluspy2/sessions/abstract.py +172 -0
  126. spluspy-2.0.6/spluspy/spluspy2/sessions/memory.py +260 -0
  127. spluspy-2.0.6/spluspy/spluspy2/sessions/sqlite.py +389 -0
  128. spluspy-2.0.6/spluspy/spluspy2/sessions/string.py +72 -0
  129. spluspy-2.0.6/spluspy/spluspy2/sync.py +74 -0
  130. spluspy-2.0.6/spluspy/spluspy2/tl/__init__.py +1 -0
  131. spluspy-2.0.6/spluspy/spluspy2/tl/alltlobjects.py +1696 -0
  132. spluspy-2.0.6/spluspy/spluspy2/tl/core/__init__.py +26 -0
  133. spluspy-2.0.6/spluspy/spluspy2/tl/core/gzippacked.py +48 -0
  134. spluspy-2.0.6/spluspy/spluspy2/tl/core/messagecontainer.py +47 -0
  135. spluspy-2.0.6/spluspy/spluspy2/tl/core/rpcresult.py +35 -0
  136. spluspy-2.0.6/spluspy/spluspy2/tl/core/tlmessage.py +34 -0
  137. spluspy-2.0.6/spluspy/spluspy2/tl/custom/__init__.py +14 -0
  138. spluspy-2.0.6/spluspy/spluspy2/tl/custom/adminlogevent.py +475 -0
  139. spluspy-2.0.6/spluspy/spluspy2/tl/custom/button.py +346 -0
  140. spluspy-2.0.6/spluspy/spluspy2/tl/custom/chatgetter.py +154 -0
  141. spluspy-2.0.6/spluspy/spluspy2/tl/custom/conversation.py +529 -0
  142. spluspy-2.0.6/spluspy/spluspy2/tl/custom/dialog.py +161 -0
  143. spluspy-2.0.6/spluspy/spluspy2/tl/custom/draft.py +194 -0
  144. spluspy-2.0.6/spluspy/spluspy2/tl/custom/file.py +146 -0
  145. spluspy-2.0.6/spluspy/spluspy2/tl/custom/forward.py +51 -0
  146. spluspy-2.0.6/spluspy/spluspy2/tl/custom/inlinebuilder.py +450 -0
  147. spluspy-2.0.6/spluspy/spluspy2/tl/custom/inlineresult.py +176 -0
  148. spluspy-2.0.6/spluspy/spluspy2/tl/custom/inlineresults.py +83 -0
  149. spluspy-2.0.6/spluspy/spluspy2/tl/custom/inputsizedfile.py +9 -0
  150. spluspy-2.0.6/spluspy/spluspy2/tl/custom/message.py +1250 -0
  151. spluspy-2.0.6/spluspy/spluspy2/tl/custom/messagebutton.py +160 -0
  152. spluspy-2.0.6/spluspy/spluspy2/tl/custom/participantpermissions.py +138 -0
  153. spluspy-2.0.6/spluspy/spluspy2/tl/custom/qrlogin.py +119 -0
  154. spluspy-2.0.6/spluspy/spluspy2/tl/custom/sendergetter.py +106 -0
  155. spluspy-2.0.6/spluspy/spluspy2/tl/custom/types.py +38 -0
  156. spluspy-2.0.6/spluspy/spluspy2/tl/functions/__init__.py +452 -0
  157. spluspy-2.0.6/spluspy/spluspy2/tl/functions/account.py +1581 -0
  158. spluspy-2.0.6/spluspy/spluspy2/tl/functions/auth.py +593 -0
  159. spluspy-2.0.6/spluspy/spluspy2/tl/functions/bots.py +112 -0
  160. spluspy-2.0.6/spluspy/spluspy2/tl/functions/channels.py +1672 -0
  161. spluspy-2.0.6/spluspy/spluspy2/tl/functions/chatlists.py +325 -0
  162. spluspy-2.0.6/spluspy/spluspy2/tl/functions/conference.py +437 -0
  163. spluspy-2.0.6/spluspy/spluspy2/tl/functions/contacts.py +476 -0
  164. spluspy-2.0.6/spluspy/spluspy2/tl/functions/folders.py +44 -0
  165. spluspy-2.0.6/spluspy/spluspy2/tl/functions/help.py +259 -0
  166. spluspy-2.0.6/spluspy/spluspy2/tl/functions/langpack.py +146 -0
  167. spluspy-2.0.6/spluspy/spluspy2/tl/functions/messages.py +5469 -0
  168. spluspy-2.0.6/spluspy/spluspy2/tl/functions/payments.py +292 -0
  169. spluspy-2.0.6/spluspy/spluspy2/tl/functions/phone.py +809 -0
  170. spluspy-2.0.6/spluspy/spluspy2/tl/functions/photos.py +282 -0
  171. spluspy-2.0.6/spluspy/spluspy2/tl/functions/premium.py +152 -0
  172. spluspy-2.0.6/spluspy/spluspy2/tl/functions/stats.py +300 -0
  173. spluspy-2.0.6/spluspy/spluspy2/tl/functions/stories.py +765 -0
  174. spluspy-2.0.6/spluspy/spluspy2/tl/functions/thirdParty.py +67 -0
  175. spluspy-2.0.6/spluspy/spluspy2/tl/functions/updates.py +139 -0
  176. spluspy-2.0.6/spluspy/spluspy2/tl/functions/upload.py +168 -0
  177. spluspy-2.0.6/spluspy/spluspy2/tl/functions/users.py +170 -0
  178. spluspy-2.0.6/spluspy/spluspy2/tl/patched/__init__.py +20 -0
  179. spluspy-2.0.6/spluspy/spluspy2/tl/tlobject.py +222 -0
  180. spluspy-2.0.6/spluspy/spluspy2/tl/types/__init__.py +40056 -0
  181. spluspy-2.0.6/spluspy/spluspy2/tl/types/account.py +1096 -0
  182. spluspy-2.0.6/spluspy/spluspy2/tl/types/auth.py +809 -0
  183. spluspy-2.0.6/spluspy/spluspy2/tl/types/bots.py +43 -0
  184. spluspy-2.0.6/spluspy/spluspy2/tl/types/channels.py +232 -0
  185. spluspy-2.0.6/spluspy/spluspy2/tl/types/chatlists.py +273 -0
  186. spluspy-2.0.6/spluspy/spluspy2/tl/types/conference.py +69 -0
  187. spluspy-2.0.6/spluspy/spluspy2/tl/types/contacts.py +478 -0
  188. spluspy-2.0.6/spluspy/spluspy2/tl/types/help.py +1206 -0
  189. spluspy-2.0.6/spluspy/spluspy2/tl/types/messages.py +3000 -0
  190. spluspy-2.0.6/spluspy/spluspy2/tl/types/payments.py +633 -0
  191. spluspy-2.0.6/spluspy/spluspy2/tl/types/phone.py +313 -0
  192. spluspy-2.0.6/spluspy/spluspy2/tl/types/photos.py +135 -0
  193. spluspy-2.0.6/spluspy/spluspy2/tl/types/premium.py +209 -0
  194. spluspy-2.0.6/spluspy/spluspy2/tl/types/stats.py +368 -0
  195. spluspy-2.0.6/spluspy/spluspy2/tl/types/stickers.py +35 -0
  196. spluspy-2.0.6/spluspy/spluspy2/tl/types/storage.py +197 -0
  197. spluspy-2.0.6/spluspy/spluspy2/tl/types/stories.py +317 -0
  198. spluspy-2.0.6/spluspy/spluspy2/tl/types/thirdParty.py +94 -0
  199. spluspy-2.0.6/spluspy/spluspy2/tl/types/update.py +39 -0
  200. spluspy-2.0.6/spluspy/spluspy2/tl/types/updates.py +447 -0
  201. spluspy-2.0.6/spluspy/spluspy2/tl/types/upload.py +196 -0
  202. spluspy-2.0.6/spluspy/spluspy2/tl/types/users.py +131 -0
  203. spluspy-2.0.6/spluspy/spluspy2/types.py +1 -0
  204. spluspy-2.0.6/spluspy/spluspy2/utils.py +1570 -0
  205. spluspy-2.0.6/spluspy/spluspy2/version.py +3 -0
  206. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/storage/base.py +9 -2
  207. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/storage/sqlite.py +4 -0
  208. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/__init__.py +6 -0
  209. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/batch.py +1 -1
  210. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/cache.py +54 -3
  211. spluspy-2.0.6/spluspy/utils/chat_lock.py +96 -0
  212. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/file_transfer.py +85 -15
  213. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/logger.py +62 -64
  214. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/rate_limiter.py +211 -211
  215. spluspy-2.0.6/spluspy/utils/resolver.py +372 -0
  216. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_client.py +33 -21
  217. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_filters.py +3 -3
  218. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_fsm_enhanced.py +12 -12
  219. spluspy-2.0.6/tests/test_resolver.py +411 -0
  220. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_storage.py +12 -0
  221. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_types.py +6 -6
  222. spluspy-2.0.4/debug_client.py +0 -829
  223. spluspy-2.0.4/examples/12_media_bot.py +0 -38
  224. spluspy-2.0.4/rename_splusthon.py +0 -280
  225. spluspy-2.0.4/spluspy/.mimocode/.cron-lock +0 -1
  226. spluspy-2.0.4/spluspy/compat.py +0 -51
  227. spluspy-2.0.4/spluspy/network/spluspy_adapter.py +0 -208
  228. spluspy-2.0.4/spluspy.spluspy +0 -0
  229. spluspy-2.0.4/tempCodeRunnerFile.py +0 -6
  230. spluspy-2.0.4/test_handlers.py +0 -85
  231. spluspy-2.0.4/testbots/main.py +0 -283
  232. spluspy-2.0.4/tests/.vscode/PythonImportHelper-v2-Completion.json +0 -843
  233. spluspy-2.0.4/tests/test_storage_backends.py +0 -52
  234. {spluspy-2.0.4 → spluspy-2.0.6}/CONTRIBUTING.md +0 -0
  235. {spluspy-2.0.4 → spluspy-2.0.6}/LICENSE +0 -0
  236. {spluspy-2.0.4 → spluspy-2.0.6}/README.rst +0 -0
  237. {spluspy-2.0.4 → spluspy-2.0.6}/examples/03_command_bot.py +0 -0
  238. {spluspy-2.0.4 → spluspy-2.0.6}/examples/08_combined_filters.py +0 -0
  239. {spluspy-2.0.4 → spluspy-2.0.6}/examples/16_scheduler_bot.py +0 -0
  240. {spluspy-2.0.4 → spluspy-2.0.6}/examples/17_conversation.py +0 -0
  241. {spluspy-2.0.4 → spluspy-2.0.6}/examples/18_chat_management.py +0 -0
  242. {spluspy-2.0.4 → spluspy-2.0.6}/examples/19_event_types.py +0 -0
  243. {spluspy-2.0.4 → spluspy-2.0.6}/examples/20_sync_bot.py +0 -0
  244. {spluspy-2.0.4 → spluspy-2.0.6}/examples/21_album_handler.py +0 -0
  245. {spluspy-2.0.4 → spluspy-2.0.6}/examples/22_download_bot.py +0 -0
  246. {spluspy-2.0.4 → spluspy-2.0.6}/examples/23_url_button.py +0 -0
  247. {spluspy-2.0.4 → spluspy-2.0.6}/examples/24_string_session.py +0 -0
  248. {spluspy-2.0.4 → spluspy-2.0.6}/examples/25_error_handling.py +0 -0
  249. {spluspy-2.0.4 → spluspy-2.0.6}/examples/25_working_bot.py +0 -0
  250. {spluspy-2.0.4 → spluspy-2.0.6}/examples/26_message_entities.py +0 -0
  251. {spluspy-2.0.4 → spluspy-2.0.6}/examples/27_search_messages.py +0 -0
  252. {spluspy-2.0.4 → spluspy-2.0.6}/examples/28_poll_bot.py +0 -0
  253. {spluspy-2.0.4 → spluspy-2.0.6}/examples/29_dice_bot.py +0 -0
  254. {spluspy-2.0.4 → spluspy-2.0.6}/examples/30_cache_bot.py +0 -0
  255. {spluspy-2.0.4 → spluspy-2.0.6}/examples/31_reaction_bot.py +0 -0
  256. {spluspy-2.0.4 → spluspy-2.0.6}/examples/32_mark_read_bot.py +0 -0
  257. {spluspy-2.0.4 → spluspy-2.0.6}/examples/33_context_manager.py +0 -0
  258. {spluspy-2.0.4 → spluspy-2.0.6}/examples/34_user_info.py +0 -0
  259. {spluspy-2.0.4 → spluspy-2.0.6}/examples/35_chat_info.py +0 -0
  260. {spluspy-2.0.4 → spluspy-2.0.6}/examples/36_forward_copy.py +0 -0
  261. {spluspy-2.0.4 → spluspy-2.0.6}/examples/37_admin_bot.py +0 -0
  262. {spluspy-2.0.4 → spluspy-2.0.6}/examples/38_media_filters.py +0 -0
  263. {spluspy-2.0.4 → spluspy-2.0.6}/examples/39_status_bot.py +0 -0
  264. {spluspy-2.0.4 → spluspy-2.0.6}/examples/40_delete_detection.py +0 -0
  265. {spluspy-2.0.4 → spluspy-2.0.6}/examples/41_read_detection.py +0 -0
  266. {spluspy-2.0.4 → spluspy-2.0.6}/examples/42_raw_events.py +0 -0
  267. {spluspy-2.0.4 → spluspy-2.0.6}/examples/43_poll_handler.py +0 -0
  268. {spluspy-2.0.4 → spluspy-2.0.6}/examples/44_reaction_handler.py +0 -0
  269. {spluspy-2.0.4 → spluspy-2.0.6}/examples/45_typing_handler.py +0 -0
  270. {spluspy-2.0.4 → spluspy-2.0.6}/examples/46_get_messages.py +0 -0
  271. {spluspy-2.0.4 → spluspy-2.0.6}/examples/47_iter_messages.py +0 -0
  272. {spluspy-2.0.4 → spluspy-2.0.6}/examples/48_get_members.py +0 -0
  273. {spluspy-2.0.4 → spluspy-2.0.6}/examples/49_resolve_username.py +0 -0
  274. {spluspy-2.0.4 → spluspy-2.0.6}/examples/50_invoke.py +0 -0
  275. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/cli.py +0 -0
  276. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/client/__init__.py +0 -0
  277. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/client/conversation.py +0 -0
  278. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/errors/__init__.py +0 -0
  279. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/errors/exceptions.py +0 -0
  280. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/__init__.py +0 -0
  281. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/album.py +0 -0
  282. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/callback.py +0 -0
  283. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/chat_action.py +0 -0
  284. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/edited.py +0 -0
  285. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/inline.py +0 -0
  286. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/message.py +0 -0
  287. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/message_deleted.py +0 -0
  288. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/message_read.py +0 -0
  289. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/events/user_update.py +0 -0
  290. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/fsm/__init__.py +0 -0
  291. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/middleware/__init__.py +0 -0
  292. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/__init__.py +0 -0
  293. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/models/enums.py +0 -0
  294. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/network/http_client.py +0 -0
  295. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/plugins/__init__.py +0 -0
  296. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/session/__init__.py +0 -0
  297. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/session/base.py +0 -0
  298. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/session/memory.py +0 -0
  299. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/session/string.py +0 -0
  300. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/storage/__init__.py +0 -0
  301. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/storage/memory.py +0 -0
  302. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/storage/postgres.py +0 -0
  303. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/storage/redis.py +0 -0
  304. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/sync/__init__.py +0 -0
  305. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/sync/client.py +0 -0
  306. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/helpers.py +0 -0
  307. {spluspy-2.0.4 → spluspy-2.0.6}/spluspy/utils/version_check.py +0 -0
  308. {spluspy-2.0.4 → spluspy-2.0.6}/tests/__init__.py +0 -0
  309. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_fsm.py +0 -0
  310. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_middleware.py +0 -0
  311. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_rate_limiter.py +0 -0
  312. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_scheduler.py +0 -0
  313. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_session.py +0 -0
  314. {spluspy-2.0.4 → spluspy-2.0.6}/tests/test_utils.py +0 -0
@@ -0,0 +1,50 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ *.egg-info/
7
+ *.egg
8
+ dist/
9
+ build/
10
+ *.whl
11
+
12
+ # Virtual environments
13
+ venv/
14
+ .venv/
15
+ env/
16
+
17
+ # IDE
18
+ .vscode/
19
+ .idea/
20
+ *.swp
21
+ *.swo
22
+ *~
23
+
24
+ # Testing
25
+ .pytest_cache/
26
+ .coverage
27
+ htmlcov/
28
+ .mypy_cache/
29
+
30
+ # Logs
31
+ *.log
32
+ logs/
33
+
34
+ # Database files
35
+ *.sqlite
36
+ *.sqlite3
37
+
38
+ # Environment
39
+ .env
40
+ .env.*
41
+
42
+ # OS
43
+ Thumbs.db
44
+ Desktop.ini
45
+ .DS_Store
46
+
47
+ # Temporary files
48
+ tempCodeRunnerFile.py
49
+ *.tmp
50
+ *.bak
@@ -5,6 +5,31 @@ All notable changes to SplusPy will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [2.0.6] - 2026-07-11
9
+
10
+ ### Fixed
11
+ - Fixed missing `Union` import in `batch.py` that caused `NameError` at runtime
12
+ - Fixed missing `copy_messages` method call in sync wrapper that caused `AttributeError`
13
+ - Removed unused `SplusConnectionError` import in `client.py`
14
+ - Fixed deprecated `asyncio.get_event_loop()` replaced with `asyncio.get_running_loop()` in network client
15
+ - Fixed FSM `on_enter`/`on_leave` hooks that were registered but never invoked
16
+ - Fixed `RateLimitMiddleware` that incremented counter but didn't actually rate-limit updates
17
+
18
+ ### Removed
19
+ - Removed unused `HttpTransport` class from transport module
20
+ - Removed duplicate `test_storage_backends.py` (merged TTL test into `test_storage.py`)
21
+
22
+ ### Changed
23
+ - Renamed `FloodWait` in `rate_limiter.py` to `FloodWaitState` to avoid confusion with `errors.FloodWait`
24
+ - Moved inline `import inspect` and `import re` to module-level imports in `client.py`
25
+ - Added `FloodWaitState` docstring clarification in rate limiter
26
+
27
+ ### Documentation
28
+ - Fixed README.md project structure: `types/` corrected to `models/`
29
+ - Fixed README.md FSM example that accessed data after `reset()`
30
+ - Fixed Dockerfile `COPY bot.py` that failed when file doesn't exist
31
+ - Added docstring for `Regex` filter side effect (`pattern_match`)
32
+
8
33
  ## [3.0.0] - 2026-07-10
9
34
 
10
35
  ### Added
@@ -14,8 +14,9 @@ COPY spluspy/ spluspy/
14
14
  # Install the package
15
15
  RUN pip install --no-cache-dir ".[all]"
16
16
 
17
- # Copy bot script if present
18
- COPY bot.py ./
17
+ # Copy bot script (pass as build arg)
18
+ ARG BOT_SCRIPT=bot.py
19
+ COPY ${BOT_SCRIPT} ./
19
20
 
20
21
  # Run the bot
21
22
  CMD ["python", "bot.py"]
@@ -2,6 +2,6 @@ include LICENSE
2
2
  include README.md
3
3
  include README.rst
4
4
  include pyproject.toml
5
- recursive-include spluspy *.py *.pyi
5
+ recursive-include spluspy *.py *.pyi py.typed
6
6
  recursive-include tests *.py
7
7
  recursive-include examples *.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spluspy
3
- Version: 2.0.4
3
+ Version: 2.0.6
4
4
  Summary: A modern async Python library for interacting with Soroush Plus
5
5
  Project-URL: Homepage, https://github.com/Itskillmaster/spluspy
6
6
  Project-URL: Documentation, https://github.com/Itskillmaster/spluspy#readme
@@ -36,6 +36,7 @@ Requires-Dist: pytest-cov>=4.0; extra == 'all'
36
36
  Requires-Dist: pytest>=7.0; extra == 'all'
37
37
  Requires-Dist: redis>=4.0; extra == 'all'
38
38
  Requires-Dist: ruff>=0.1.0; extra == 'all'
39
+ Requires-Dist: uvloop>=0.19.0; (sys_platform != 'win32') and extra == 'all'
39
40
  Provides-Extra: dev
40
41
  Requires-Dist: black>=23.0; extra == 'dev'
41
42
  Requires-Dist: mypy>=1.0; extra == 'dev'
@@ -50,6 +51,7 @@ Requires-Dist: redis>=4.0; extra == 'redis'
50
51
  Provides-Extra: speed
51
52
  Requires-Dist: cryptg; extra == 'speed'
52
53
  Requires-Dist: orjson>=3.9.0; extra == 'speed'
54
+ Requires-Dist: uvloop>=0.19.0; (sys_platform != 'win32') and extra == 'speed'
53
55
  Description-Content-Type: text/markdown
54
56
 
55
57
  <div align="center">
@@ -309,8 +311,9 @@ async def process_form(client, message):
309
311
  await message.reply("How old are you?")
310
312
  elif state == Form.age:
311
313
  await ctx.set_data(age=message.text)
314
+ data = await ctx.get_data()
312
315
  await ctx.reset()
313
- await message.reply(f"Registered! Name: {(await ctx.get_data()).get('name')}")
316
+ await message.reply(f"Registered! Name: {data.get('name')}")
314
317
  ```
315
318
 
316
319
  #### Advanced FSM: State Routing with Decorators
@@ -542,7 +545,7 @@ spluspy/
542
545
  ├── config.py # Configuration
543
546
  ├── compat.py # Compatibility layer
544
547
  ├── client/ # Client and conversation API
545
- ├── types/ # Domain models (Message, User, Chat, Media, etc.)
548
+ ├── models/ # Domain models (Message, User, Chat, Media, etc.)
546
549
  ├── events/ # Event types and builders
547
550
  ├── filters/ # Composable message filters
548
551
  ├── errors/ # Custom exception hierarchy
@@ -255,8 +255,9 @@ async def process_form(client, message):
255
255
  await message.reply("How old are you?")
256
256
  elif state == Form.age:
257
257
  await ctx.set_data(age=message.text)
258
+ data = await ctx.get_data()
258
259
  await ctx.reset()
259
- await message.reply(f"Registered! Name: {(await ctx.get_data()).get('name')}")
260
+ await message.reply(f"Registered! Name: {data.get('name')}")
260
261
  ```
261
262
 
262
263
  #### Advanced FSM: State Routing with Decorators
@@ -488,7 +489,7 @@ spluspy/
488
489
  ├── config.py # Configuration
489
490
  ├── compat.py # Compatibility layer
490
491
  ├── client/ # Client and conversation API
491
- ├── types/ # Domain models (Message, User, Chat, Media, etc.)
492
+ ├── models/ # Domain models (Message, User, Chat, Media, etc.)
492
493
  ├── events/ # Event types and builders
493
494
  ├── filters/ # Composable message filters
494
495
  ├── errors/ # Custom exception hierarchy
@@ -5,8 +5,7 @@ The simplest possible SplusPy bot that replies "Hello!" to any message.
5
5
 
6
6
  from spluspy import Client
7
7
 
8
- # Use session_name for clarity
9
- bot = Client(session_name="hello_session")
8
+ bot = Client("hello_session")
10
9
 
11
10
 
12
11
  @bot.on_message()
@@ -5,7 +5,7 @@ Echoes back any text message it receives.
5
5
 
6
6
  from spluspy import Client, filters
7
7
 
8
- bot = Client(session_name="echo_session")
8
+ bot = Client("echo_session")
9
9
 
10
10
 
11
11
  @bot.on_message(filters.text)
@@ -3,16 +3,15 @@
3
3
  Only responds to messages in private chats.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import filters
6
+ from spluspy import Client, filters
8
7
 
9
8
  bot = Client("private_session")
10
9
 
11
10
 
12
11
  @bot.on_message(filters.private)
13
- async def private_handler(m):
12
+ async def private_handler(client, message):
14
13
  """Handle messages in private chats only."""
15
- await m.reply("This is a private chat!")
14
+ await message.reply("This is a private chat!")
16
15
 
17
16
 
18
17
  if __name__ == "__main__":
@@ -3,16 +3,15 @@
3
3
  Only responds to messages in group chats.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import filters
6
+ from spluspy import Client, filters
8
7
 
9
8
  bot = Client("group_session")
10
9
 
11
10
 
12
11
  @bot.on_message(filters.group)
13
- async def group_handler(m):
12
+ async def group_handler(client, message):
14
13
  """Handle messages in group chats only."""
15
- await m.reply("This is a group chat!")
14
+ await message.reply("This is a group chat!")
16
15
 
17
16
 
18
17
  if __name__ == "__main__":
@@ -3,23 +3,22 @@
3
3
  Matches messages using regex patterns.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import filters
6
+ from spluspy import Client, filters
8
7
 
9
8
  bot = Client("regex_session")
10
9
 
11
10
 
12
11
  @bot.on_message(filters.regex(r"\d+"))
13
- async def number_handler(m):
12
+ async def number_handler(client, message):
14
13
  """Handle messages containing numbers."""
15
- numbers = m.pattern_match.group()
16
- await m.reply(f"I found a number: {numbers}")
14
+ numbers = message.pattern_match.group()
15
+ await message.reply(f"I found a number: {numbers}")
17
16
 
18
17
 
19
18
  @bot.on_message(filters.regex(r"(?i)hello|hi|hey"))
20
- async def greeting_handler(m):
19
+ async def greeting_handler(client, message):
21
20
  """Handle greeting messages."""
22
- await m.reply("Hey there!")
21
+ await message.reply("Hey there!")
23
22
 
24
23
 
25
24
  if __name__ == "__main__":
@@ -3,8 +3,7 @@
3
3
  Responds only to specific users.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import filters
6
+ from spluspy import Client, filters
8
7
 
9
8
  bot = Client("user_filter_session")
10
9
 
@@ -13,15 +12,15 @@ ALLOWED_USERS = [123456, 789012]
13
12
 
14
13
 
15
14
  @bot.on_message(filters.user(*ALLOWED_USERS))
16
- async def allowed_handler(m):
15
+ async def allowed_handler(client, message):
17
16
  """Handle messages from allowed users only."""
18
- await m.reply("Hello authorized user!")
17
+ await message.reply("Hello authorized user!")
19
18
 
20
19
 
21
20
  @bot.on_message()
22
- async def unauthorized_handler(m):
21
+ async def unauthorized_handler(client, message):
23
22
  """Handle messages from unauthorized users."""
24
- await m.reply("Sorry, you are not authorized.")
23
+ await message.reply("Sorry, you are not authorized.")
25
24
 
26
25
 
27
26
  if __name__ == "__main__":
@@ -3,14 +3,13 @@
3
3
  Demonstrates inline keyboard buttons and callback queries.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import Button, filters
6
+ from spluspy import Client, Button, filters
8
7
 
9
8
  bot = Client("keyboard_session")
10
9
 
11
10
 
12
11
  @bot.on_message(filters.command("menu"))
13
- async def menu_handler(m):
12
+ async def menu_handler(client, message):
14
13
  """Show an inline keyboard menu."""
15
14
  keyboard = Button.build_inline(
16
15
  [
@@ -18,19 +17,19 @@ async def menu_handler(m):
18
17
  [Button.inline("Option 3", b"opt3")],
19
18
  ]
20
19
  )
21
- await m.reply("Choose an option:", buttons=keyboard)
20
+ await message.reply("Choose an option:", buttons=keyboard)
22
21
 
23
22
 
24
23
  @bot.on_callback_query()
25
- async def callback_handler(cb):
24
+ async def callback_handler(client, callback):
26
25
  """Handle inline button clicks."""
27
- data = cb.text
26
+ data = callback.text
28
27
  if data == "opt1":
29
- await cb.answer("You chose Option 1!")
28
+ await callback.answer("You chose Option 1!")
30
29
  elif data == "opt2":
31
- await cb.answer("You chose Option 2!")
30
+ await callback.answer("You chose Option 2!")
32
31
  elif data == "opt3":
33
- await cb.answer("You chose Option 3!")
32
+ await callback.answer("You chose Option 3!")
34
33
 
35
34
 
36
35
  if __name__ == "__main__":
@@ -3,32 +3,31 @@
3
3
  Demonstrates reply keyboards (replacing the user's keyboard).
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import Button, filters
6
+ from spluspy import Client, Button, filters
8
7
 
9
8
  bot = Client("reply_keyboard_session")
10
9
 
11
10
 
12
11
  @bot.on_message(filters.command("menu"))
13
- async def menu_handler(m):
12
+ async def menu_handler(client, message):
14
13
  """Show a reply keyboard."""
15
14
  keyboard = Button.build_reply(
16
15
  [Button.text("Settings"), Button.text("Profile")],
17
16
  [Button.text("Help")],
18
17
  )
19
- await m.reply("Choose:", buttons=keyboard)
18
+ await message.reply("Choose:", buttons=keyboard)
20
19
 
21
20
 
22
21
  @bot.on_message(filters.command("clear"))
23
- async def clear_handler(m):
22
+ async def clear_handler(client, message):
24
23
  """Clear the keyboard."""
25
- await m.reply("Keyboard cleared!", buttons=Button.clear())
24
+ await message.reply("Keyboard cleared!", buttons=Button.clear())
26
25
 
27
26
 
28
27
  @bot.on_message(filters.text)
29
- async def text_handler(m):
28
+ async def text_handler(client, message):
30
29
  """Handle text messages."""
31
- await m.reply(f"You pressed: {m.text}")
30
+ await message.reply(f"You pressed: {message.text}")
32
31
 
33
32
 
34
33
  if __name__ == "__main__":
@@ -3,38 +3,36 @@
3
3
  Demonstrates various message actions like edit, delete, forward, pin.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import filters
6
+ from spluspy import Client, filters
8
7
 
9
8
  bot = Client("actions_session")
10
9
 
11
10
 
12
11
  @bot.on_message(filters.command("edit"))
13
- async def edit_example(m):
12
+ async def edit_example(client, message):
14
13
  """Demonstrate message editing."""
15
- sent = await m.reply("This message will be edited...")
14
+ sent = await message.reply("This message will be edited...")
16
15
  await sent.edit("Message edited successfully!")
17
16
 
18
17
 
19
18
  @bot.on_message(filters.command("pin"))
20
- async def pin_example(m):
19
+ async def pin_example(client, message):
21
20
  """Demonstrate message pinning."""
22
- sent = await m.reply("This message will be pinned!")
21
+ sent = await message.reply("This message will be pinned!")
23
22
  await sent.pin(notify=True)
24
23
 
25
24
 
26
25
  @bot.on_message(filters.command("forward"))
27
- async def forward_example(m):
26
+ async def forward_example(client, message):
28
27
  """Demonstrate message forwarding."""
29
- await m.reply("Forwarding this message...")
30
- # await m.forward(target_chat_id)
28
+ await message.reply("Forwarding this message...")
31
29
 
32
30
 
33
31
  @bot.on_message(filters.command("react"))
34
- async def react_example(m):
32
+ async def react_example(client, message):
35
33
  """Demonstrate reactions."""
36
- await m.react("❤️")
37
- await m.reply("Reaction added!")
34
+ await message.react("❤️")
35
+ await message.reply("Reaction added!")
38
36
 
39
37
 
40
38
  if __name__ == "__main__":
@@ -0,0 +1,36 @@
1
+ """Example 12: Media Bot
2
+
3
+ Demonstrates sending different types of media.
4
+ """
5
+
6
+ from spluspy import Client, filters
7
+
8
+ bot = Client("media_session")
9
+
10
+
11
+ @bot.on_message(filters.command("photo"))
12
+ async def photo_example(client, message):
13
+ """Send a photo."""
14
+ await message.reply_photo("https://example.com/photo.jpg", caption="Here is a photo!")
15
+
16
+
17
+ @bot.on_message(filters.command("video"))
18
+ async def video_example(client, message):
19
+ """Send a video."""
20
+ await message.reply_video("https://example.com/video.mp4", caption="Here is a video!")
21
+
22
+
23
+ @bot.on_message(filters.command("document"))
24
+ async def document_example(client, message):
25
+ """Send a document."""
26
+ await message.reply_document("https://example.com/file.pdf", caption="Here is a document!")
27
+
28
+
29
+ @bot.on_message(filters.command("location"))
30
+ async def location_example(client, message):
31
+ """Send a location."""
32
+ await message.reply("Sending location...")
33
+
34
+
35
+ if __name__ == "__main__":
36
+ bot.run()
@@ -3,8 +3,7 @@
3
3
  Demonstrates the Finite State Machine for conversational flows.
4
4
  """
5
5
 
6
- from spluspy import Client
7
- from spluspy import filters
6
+ from spluspy import Client, filters
8
7
  from spluspy.fsm import State, StateMachine
9
8
  from spluspy.storage import MemoryStorage
10
9
 
@@ -22,40 +21,40 @@ class RegistrationForm:
22
21
 
23
22
 
24
23
  @bot.on_message(filters.command("register"))
25
- async def start_registration(m):
24
+ async def start_registration(client, message):
26
25
  """Start the registration flow."""
27
- ctx = fsm.context(m.sender_id)
26
+ ctx = fsm.context(message.sender_id)
28
27
  await ctx.set_state(RegistrationForm.name)
29
- await m.reply("What is your name?")
28
+ await message.reply("What is your name?")
30
29
 
31
30
 
32
31
  @bot.on_message(filters.private)
33
- async def process_form(m):
32
+ async def process_form(client, message):
34
33
  """Process form responses based on current state."""
35
- ctx = fsm.context(m.sender_id)
34
+ ctx = fsm.context(message.sender_id)
36
35
  state = await ctx.get_state()
37
36
 
38
37
  if state is None:
39
38
  return
40
39
 
41
40
  if state == RegistrationForm.name:
42
- await ctx.set_data(name=m.text)
41
+ await ctx.set_data(name=message.text)
43
42
  await ctx.set_state(RegistrationForm.age)
44
- await m.reply("How old are you?")
43
+ await message.reply("How old are you?")
45
44
 
46
45
  elif state == RegistrationForm.age:
47
- await ctx.set_data(age=m.text)
46
+ await ctx.set_data(age=message.text)
48
47
  await ctx.set_state(RegistrationForm.city)
49
- await m.reply("Which city are you from?")
48
+ await message.reply("Which city are you from?")
50
49
 
51
50
  elif state == RegistrationForm.city:
52
51
  data = await ctx.get_data()
53
52
  await ctx.reset()
54
- await m.reply(
53
+ await message.reply(
55
54
  f"Registration complete!\n"
56
55
  f"Name: {data.get('name')}\n"
57
56
  f"Age: {data.get('age')}\n"
58
- f"City: {m.text}"
57
+ f"City: {message.text}"
59
58
  )
60
59
 
61
60
 
@@ -6,6 +6,8 @@ Demonstrates the plugin loading system.
6
6
  # plugins/greetings.py
7
7
  """Greeting plugin."""
8
8
 
9
+ from spluspy import filters
10
+
9
11
  GREETINGS = {
10
12
  "hello": "Hello there!",
11
13
  "hi": "Hey!",
@@ -18,14 +20,14 @@ def register(client):
18
20
  """Register plugin handlers with the client."""
19
21
 
20
22
  @client.on_message(filters.command("greet"))
21
- async def greet_handler(m):
22
- await m.reply("Available greetings: hello, hi, salam, bye")
23
+ async def greet_handler(client, message):
24
+ await message.reply("Available greetings: hello, hi, salam, bye")
23
25
 
24
26
  @client.on_message(filters.text)
25
- async def auto_greet(m):
26
- text = m.text.lower().strip()
27
+ async def auto_greet(client, message):
28
+ text = message.text.lower().strip()
27
29
  if text in GREETINGS:
28
- await m.reply(GREETINGS[text])
30
+ await message.reply(GREETINGS[text])
29
31
 
30
32
 
31
33
  # main.py
@@ -33,8 +33,8 @@ bot.middleware.add(LoggingMiddleware())
33
33
 
34
34
 
35
35
  @bot.on_message()
36
- async def handler(m):
37
- await m.reply("Hello!")
36
+ async def handler(client, message):
37
+ await message.reply("Hello!")
38
38
 
39
39
 
40
40
  if __name__ == "__main__":
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "spluspy"
7
- version = "2.0.4"
7
+ version = "2.0.6"
8
8
  description = "A modern async Python library for interacting with Soroush Plus"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -43,6 +43,7 @@ dependencies = [
43
43
  speed = [
44
44
  "cryptg",
45
45
  "orjson>=3.9.0",
46
+ "uvloop>=0.19.0; sys_platform != 'win32'",
46
47
  ]
47
48
  redis = [
48
49
  "redis>=4.0",
@@ -64,6 +64,7 @@ from spluspy.fsm import State, StateMachine, FSMContext, StateTransition
64
64
  from spluspy.storage import Storage, MemoryStorage, SQLiteStorage, get_storage
65
65
  from spluspy.middleware.base import Middleware, MiddlewareManager
66
66
  from spluspy.middleware.rate_limit import RateLimitMiddleware
67
+ from spluspy.network.protocols import IAdapter, ITransport, IStorage, IEventDispatcher
67
68
  from spluspy.utils.logger import (
68
69
  setup_logging,
69
70
  get_logger,
@@ -72,6 +73,11 @@ from spluspy.utils.logger import (
72
73
  )
73
74
  from spluspy.utils.rate_limiter import RateLimiter, FloodWaitError
74
75
  from spluspy.utils.cache import LRUCache, EntityCache
76
+ from spluspy.utils.resolver import TargetResolver, TargetResolution, resolve_reply_sender
77
+ from spluspy.afk import AfkManager
78
+ from spluspy.admin import ChatAdmin
79
+ from spluspy.mirror import MessageMirror
80
+ from spluspy.scheduler.scheduler import MessageScheduler
75
81
 
76
82
  __all__ = [
77
83
  "__version__",
@@ -124,10 +130,21 @@ __all__ = [
124
130
  "Middleware",
125
131
  "MiddlewareManager",
126
132
  "RateLimitMiddleware",
133
+ "IAdapter",
134
+ "ITransport",
135
+ "IStorage",
136
+ "IEventDispatcher",
127
137
  "RateLimiter",
128
138
  "FloodWaitError",
129
139
  "LRUCache",
130
140
  "EntityCache",
141
+ "TargetResolver",
142
+ "TargetResolution",
143
+ "resolve_reply_sender",
144
+ "AfkManager",
145
+ "ChatAdmin",
146
+ "MessageMirror",
147
+ "MessageScheduler",
131
148
  "setup_logging",
132
149
  "get_logger",
133
150
  "set_level",
@@ -1,6 +1,6 @@
1
1
  """SplusPy version information."""
2
2
 
3
- __version__ = "2.0.4"
3
+ __version__ = "2.0.6"
4
4
  __author__ = "Ali Mirshekari"
5
5
  __license__ = "MIT"
6
6
  __url__ = "https://github.com/Itskillmaster/spluspy"