spluspy 2.2.8__tar.gz → 2.2.9__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. {spluspy-2.2.8/spluspy.egg-info → spluspy-2.2.9}/PKG-INFO +3 -3
  2. {spluspy-2.2.8 → spluspy-2.2.9}/README.md +2 -2
  3. {spluspy-2.2.8 → spluspy-2.2.9}/pyproject.toml +1 -1
  4. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/updates.py +2 -18
  5. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/users.py +16 -2
  6. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/common.py +9 -3
  7. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/memory.py +11 -3
  8. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/utils.py +3 -5
  9. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/version.py +1 -1
  10. {spluspy-2.2.8 → spluspy-2.2.9/spluspy.egg-info}/PKG-INFO +3 -3
  11. {spluspy-2.2.8 → spluspy-2.2.9}/LICENSE +0 -0
  12. {spluspy-2.2.8 → spluspy-2.2.9}/setup.cfg +0 -0
  13. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/__init__.py +0 -0
  14. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/__init__.py +0 -0
  15. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/entitycache.py +0 -0
  16. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/messagebox.py +0 -0
  17. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/session.py +0 -0
  18. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/admin.py +0 -0
  19. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/__init__.py +0 -0
  20. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/account.py +0 -0
  21. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/auth.py +0 -0
  22. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/buttons.py +0 -0
  23. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/chats.py +0 -0
  24. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/dialogs.py +0 -0
  25. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/downloads.py +0 -0
  26. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/extra.py +0 -0
  27. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/messageparse.py +0 -0
  28. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/messages.py +0 -0
  29. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/soroushclient.py +0 -0
  30. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/telegrambaseclient.py +0 -0
  31. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/uploads.py +0 -0
  32. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/__init__.py +0 -0
  33. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/aes.py +0 -0
  34. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/aesctr.py +0 -0
  35. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/authkey.py +0 -0
  36. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/cdndecrypter.py +0 -0
  37. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/factorization.py +0 -0
  38. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/libssl.py +0 -0
  39. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/rsa.py +0 -0
  40. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/custom.py +0 -0
  41. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/enums.py +0 -0
  42. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/__init__.py +0 -0
  43. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/common.py +0 -0
  44. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/exceptions.py +0 -0
  45. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/rpcbaseerrors.py +0 -0
  46. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/rpcerrorlist.py +0 -0
  47. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/__init__.py +0 -0
  48. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/album.py +0 -0
  49. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/chataction.py +0 -0
  50. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/messagedeleted.py +0 -0
  51. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/messageedited.py +0 -0
  52. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/messageread.py +0 -0
  53. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/newmessage.py +0 -0
  54. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/raw.py +0 -0
  55. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/userupdate.py +0 -0
  56. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/__init__.py +0 -0
  57. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/binaryreader.py +0 -0
  58. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/html.py +0 -0
  59. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/markdown.py +0 -0
  60. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/messagepacker.py +0 -0
  61. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/filters.py +0 -0
  62. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/functions.py +0 -0
  63. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/helpers.py +0 -0
  64. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/hints.py +0 -0
  65. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/__init__.py +0 -0
  66. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/authenticator.py +0 -0
  67. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/__init__.py +0 -0
  68. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/connection.py +0 -0
  69. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/http.py +0 -0
  70. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpabridged.py +0 -0
  71. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpfull.py +0 -0
  72. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpintermediate.py +0 -0
  73. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpmtproxy.py +0 -0
  74. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpobfuscated.py +0 -0
  75. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/websocket.py +0 -0
  76. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/mtprotoplainsender.py +0 -0
  77. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/mtprotosender.py +0 -0
  78. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/mtprotostate.py +0 -0
  79. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/requeststate.py +0 -0
  80. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/password.py +0 -0
  81. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/requestiter.py +0 -0
  82. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/resolvers.py +0 -0
  83. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/__init__.py +0 -0
  84. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/abstract.py +0 -0
  85. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/sqlite.py +0 -0
  86. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/string.py +0 -0
  87. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sync.py +0 -0
  88. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/__init__.py +0 -0
  89. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/alltlobjects.py +0 -0
  90. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/__init__.py +0 -0
  91. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/gzippacked.py +0 -0
  92. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/messagecontainer.py +0 -0
  93. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/rpcresult.py +0 -0
  94. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/tlmessage.py +0 -0
  95. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/__init__.py +0 -0
  96. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/adminlogevent.py +0 -0
  97. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/button.py +0 -0
  98. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/chatgetter.py +0 -0
  99. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/conversation.py +0 -0
  100. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/dialog.py +0 -0
  101. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/draft.py +0 -0
  102. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/file.py +0 -0
  103. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/forward.py +0 -0
  104. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/inputsizedfile.py +0 -0
  105. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/message.py +0 -0
  106. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/messagebutton.py +0 -0
  107. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/participantpermissions.py +0 -0
  108. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/qrlogin.py +0 -0
  109. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/sendergetter.py +0 -0
  110. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/types.py +0 -0
  111. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/__init__.py +0 -0
  112. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/account.py +0 -0
  113. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/auth.py +0 -0
  114. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/bots.py +0 -0
  115. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/channels.py +0 -0
  116. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/chatlists.py +0 -0
  117. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/conference.py +0 -0
  118. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/contacts.py +0 -0
  119. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/folders.py +0 -0
  120. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/help.py +0 -0
  121. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/langpack.py +0 -0
  122. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/messages.py +0 -0
  123. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/payments.py +0 -0
  124. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/phone.py +0 -0
  125. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/photos.py +0 -0
  126. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/premium.py +0 -0
  127. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/stats.py +0 -0
  128. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/stories.py +0 -0
  129. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/thirdParty.py +0 -0
  130. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/updates.py +0 -0
  131. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/upload.py +0 -0
  132. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/users.py +0 -0
  133. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/patched/__init__.py +0 -0
  134. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/tlobject.py +0 -0
  135. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/__init__.py +0 -0
  136. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/account.py +0 -0
  137. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/auth.py +0 -0
  138. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/bots.py +0 -0
  139. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/channels.py +0 -0
  140. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/chatlists.py +0 -0
  141. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/conference.py +0 -0
  142. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/contacts.py +0 -0
  143. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/help.py +0 -0
  144. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/messages.py +0 -0
  145. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/payments.py +0 -0
  146. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/phone.py +0 -0
  147. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/photos.py +0 -0
  148. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/premium.py +0 -0
  149. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/stats.py +0 -0
  150. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/stickers.py +0 -0
  151. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/storage.py +0 -0
  152. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/stories.py +0 -0
  153. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/thirdParty.py +0 -0
  154. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/update.py +0 -0
  155. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/updates.py +0 -0
  156. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/upload.py +0 -0
  157. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/users.py +0 -0
  158. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/SOURCES.txt +0 -0
  159. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/dependency_links.txt +0 -0
  160. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/requires.txt +0 -0
  161. {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spluspy
3
- Version: 2.2.8
3
+ Version: 2.2.9
4
4
  Summary: High-performance Python Self-Bot Framework for Soroush Plus
5
5
  Author: Ali Mirshekari
6
6
  License: MIT
@@ -26,7 +26,7 @@ Requires-Dist: rsa
26
26
  Requires-Dist: pyaes
27
27
  Dynamic: license-file
28
28
 
29
- # SplusPy v2.2.8
29
+ # SplusPy v2.2.9
30
30
 
31
31
 
32
32
  **A fast, minimal, and fully-featured self-bot framework**
@@ -37,7 +37,7 @@ Dynamic: license-file
37
37
 
38
38
  SplusPy is a Python library designed specifically for building **Soroush Plus self-bots** (userbots). It provides a clean, intuitive API for automating your personal Soroush Plus account with ease.
39
39
 
40
- > ⚠️ **Note:** This is a **self-bot framework** — it operates on your personal account, not a bot account. Please adhere to Telegram's Terms of Service.
40
+ > ⚠️ **Note:** This is a **self-bot framework** — it operates on your personal account, not a bot account. Please adhere to Soroush's Terms of Service.
41
41
 
42
42
  ---
43
43
 
@@ -1,4 +1,4 @@
1
- # SplusPy v2.2.8
1
+ # SplusPy v2.2.9
2
2
 
3
3
 
4
4
  **A fast, minimal, and fully-featured self-bot framework**
@@ -9,7 +9,7 @@
9
9
 
10
10
  SplusPy is a Python library designed specifically for building **Soroush Plus self-bots** (userbots). It provides a clean, intuitive API for automating your personal Soroush Plus account with ease.
11
11
 
12
- > ⚠️ **Note:** This is a **self-bot framework** — it operates on your personal account, not a bot account. Please adhere to Telegram's Terms of Service.
12
+ > ⚠️ **Note:** This is a **self-bot framework** — it operates on your personal account, not a bot account. Please adhere to Soroush's Terms of Service.
13
13
 
14
14
  ---
15
15
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "spluspy"
7
- version = "2.2.8"
7
+ version = "2.2.9"
8
8
  description = "High-performance Python Self-Bot Framework for Soroush Plus"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -298,6 +298,8 @@ class UpdateMethods:
298
298
  event = None
299
299
  if isinstance(update, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
300
300
  event = NewMessage.build(update, None, self._mb_entity_cache.self_id)
301
+ if event is None and isinstance(update.message, types.MessageService):
302
+ event = ChatAction.build(update, None, self._mb_entity_cache.self_id)
301
303
  elif isinstance(update, (types.UpdateEditMessage, types.UpdateEditChannelMessage)):
302
304
  event = MessageEdited.build(update, None, self._mb_entity_cache.self_id)
303
305
  elif isinstance(update, (types.UpdateDeleteMessages, types.UpdateDeleteChannelMessages)):
@@ -317,24 +319,6 @@ class UpdateMethods:
317
319
  types.UpdateChannelUserTyping,
318
320
  )):
319
321
  event = UserUpdate.build(update, None, self._mb_entity_cache.self_id)
320
- elif isinstance(update, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
321
- # Check for service messages that are ChatActions
322
- msg = update.message
323
- if isinstance(msg, types.MessageService) and isinstance(msg.action, (
324
- types.MessageActionChatJoinedByLink,
325
- types.MessageActionChatAddUser,
326
- types.MessageActionChatDeleteUser,
327
- types.MessageActionChatCreate,
328
- types.MessageActionChannelCreate,
329
- types.MessageActionChatEditTitle,
330
- types.MessageActionChatEditPhoto,
331
- types.MessageActionChatDeletePhoto,
332
- types.MessageActionPinMessage,
333
- types.MessageActionGameScore,
334
- )):
335
- event = ChatAction.build(update, None, self._mb_entity_cache.self_id)
336
- else:
337
- event = NewMessage.build(update, None, self._mb_entity_cache.self_id)
338
322
 
339
323
  # For Raw handlers, always dispatch with the raw update
340
324
  raw_event = update
@@ -483,6 +483,18 @@ class UserMethods:
483
483
  'GetUsersRequest with access_hash=0 failed for user %s, '
484
484
  'trying contacts fallback', peer.user_id)
485
485
 
486
+ # SoroushPlus groups are channels. A bare positive ID may actually
487
+ # be a group, so try resolving it as a channel before giving up.
488
+ try:
489
+ channels = await self(functions.channels.GetChannelsRequest([
490
+ types.InputChannel(peer.user_id, access_hash=0)]))
491
+ if channels.chats:
492
+ return utils.get_input_peer(channels.chats[0])
493
+ except errors.RPCError:
494
+ _log.debug(
495
+ 'GetChannelsRequest with access_hash=0 failed for %s',
496
+ peer.user_id)
497
+
486
498
  # Fallback: search contacts for the user by ID
487
499
  try:
488
500
  contacts = (await self(
@@ -510,8 +522,10 @@ class UserMethods:
510
522
  )
511
523
 
512
524
  async def _get_peer(self: 'SoroushClient', peer: 'hints.EntityLike'):
513
- i, cls = utils.resolve_id(await self.get_peer_id(peer))
514
- return cls(i)
525
+ if isinstance(peer, int):
526
+ i, cls = utils.resolve_id(await self.get_peer_id(peer))
527
+ return cls(i)
528
+ return utils.get_peer(peer)
515
529
 
516
530
  async def get_peer_id(
517
531
  self: 'SoroushClient',
@@ -19,9 +19,15 @@ async def _into_id_set(client, chats):
19
19
  for chat in chats:
20
20
  if isinstance(chat, int):
21
21
  if chat < 0:
22
- result.add(chat) # Explicitly marked IDs are negative
22
+ # Explicitly marked IDs (e.g. legacy "-100...") are kept, and
23
+ # their unmarked form is also added so both styles match.
24
+ result.add(chat)
25
+ result.add(utils.resolve_id(chat)[0])
23
26
  else:
24
- result.update({ # Support all valid types of peers
27
+ # A bare positive ID in SoroushPlus can be a user or a group
28
+ # (channels), so add every possible representation to match
29
+ # whichever type the chat actually is.
30
+ result.update({
25
31
  utils.get_peer_id(types.PeerUser(chat)),
26
32
  utils.get_peer_id(types.PeerChat(chat)),
27
33
  utils.get_peer_id(types.PeerChannel(chat)),
@@ -122,7 +128,7 @@ class EventBuilder(abc.ABC):
122
128
  return
123
129
 
124
130
  if self.filters:
125
- if not await self.filters(event.client, event.message if hasattr(event, 'message') else event):
131
+ if not await self.filters(event.client, event):
126
132
  return
127
133
 
128
134
  if not self.func:
@@ -5,7 +5,7 @@ from .. import utils
5
5
  from ..tl import TLObject
6
6
  from ..tl.types import (
7
7
  PeerUser, PeerChat, PeerChannel,
8
- InputPeerUser, InputPeerChat, InputPeerChannel,
8
+ InputPeerUser, InputPeerChat, InputPeerChannel, InputPeerSelf,
9
9
  InputPhoto, InputDocument
10
10
  )
11
11
 
@@ -110,7 +110,6 @@ class MemorySession(Session):
110
110
  return
111
111
  try:
112
112
  p = utils.get_input_peer(e, allow_self=False)
113
- marked_id = utils.get_peer_id(p)
114
113
  except TypeError:
115
114
  # Note: `get_input_peer` already checks for non-zero `access_hash`.
116
115
  # See issues #354 and #392. It also checks that the entity
@@ -118,10 +117,19 @@ class MemorySession(Session):
118
117
  # anywhere (since layer 102, there are two access hashes).
119
118
  return
120
119
 
121
- if isinstance(p, (InputPeerUser, InputPeerChannel)):
120
+ if isinstance(p, InputPeerSelf):
121
+ return
122
+ elif isinstance(p, InputPeerChannel):
123
+ # Keep the "-100" mark so the session can later tell a channel
124
+ # (group) apart from a user when resolving a bare ID.
125
+ marked_id = -(1000000000000 + p.channel_id)
122
126
  p_hash = p.access_hash
123
127
  elif isinstance(p, InputPeerChat):
128
+ marked_id = -p.chat_id
124
129
  p_hash = 0
130
+ elif isinstance(p, InputPeerUser):
131
+ marked_id = p.user_id
132
+ p_hash = p.access_hash
125
133
  else:
126
134
  return
127
135
 
@@ -1042,11 +1042,9 @@ def get_peer_id(peer, add_mark=True):
1042
1042
  if not (0 < peer.channel_id <= 9999999999):
1043
1043
  peer.channel_id = resolve_id(peer.channel_id)[0]
1044
1044
 
1045
- if not add_mark:
1046
- return peer.channel_id
1047
-
1048
- # Growing backwards from -100_0000_000_000 indicates it's a channel
1049
- return -(1000000000000 + peer.channel_id)
1045
+ # SoroushPlus only has a single type of group (channels), so group
1046
+ # IDs are returned as-is without the Telegram "-100" bot-API mark.
1047
+ return peer.channel_id
1050
1048
 
1051
1049
 
1052
1050
  def resolve_id(marked_id):
@@ -1,3 +1,3 @@
1
1
  # Versions should comply with PEP440.
2
2
  # This line is parsed in setup.py:
3
- __version__ = '2.2.8'
3
+ __version__ = '2.2.9'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spluspy
3
- Version: 2.2.8
3
+ Version: 2.2.9
4
4
  Summary: High-performance Python Self-Bot Framework for Soroush Plus
5
5
  Author: Ali Mirshekari
6
6
  License: MIT
@@ -26,7 +26,7 @@ Requires-Dist: rsa
26
26
  Requires-Dist: pyaes
27
27
  Dynamic: license-file
28
28
 
29
- # SplusPy v2.2.8
29
+ # SplusPy v2.2.9
30
30
 
31
31
 
32
32
  **A fast, minimal, and fully-featured self-bot framework**
@@ -37,7 +37,7 @@ Dynamic: license-file
37
37
 
38
38
  SplusPy is a Python library designed specifically for building **Soroush Plus self-bots** (userbots). It provides a clean, intuitive API for automating your personal Soroush Plus account with ease.
39
39
 
40
- > ⚠️ **Note:** This is a **self-bot framework** — it operates on your personal account, not a bot account. Please adhere to Telegram's Terms of Service.
40
+ > ⚠️ **Note:** This is a **self-bot framework** — it operates on your personal account, not a bot account. Please adhere to Soroush's Terms of Service.
41
41
 
42
42
  ---
43
43
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes