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.
- {spluspy-2.2.8/spluspy.egg-info → spluspy-2.2.9}/PKG-INFO +3 -3
- {spluspy-2.2.8 → spluspy-2.2.9}/README.md +2 -2
- {spluspy-2.2.8 → spluspy-2.2.9}/pyproject.toml +1 -1
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/updates.py +2 -18
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/users.py +16 -2
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/common.py +9 -3
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/memory.py +11 -3
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/utils.py +3 -5
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/version.py +1 -1
- {spluspy-2.2.8 → spluspy-2.2.9/spluspy.egg-info}/PKG-INFO +3 -3
- {spluspy-2.2.8 → spluspy-2.2.9}/LICENSE +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/setup.cfg +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/entitycache.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/messagebox.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/_updates/session.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/admin.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/account.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/auth.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/buttons.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/chats.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/dialogs.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/downloads.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/extra.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/messageparse.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/messages.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/soroushclient.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/telegrambaseclient.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/client/uploads.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/aes.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/aesctr.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/authkey.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/cdndecrypter.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/factorization.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/libssl.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/crypto/rsa.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/custom.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/enums.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/common.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/exceptions.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/rpcbaseerrors.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/errors/rpcerrorlist.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/album.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/chataction.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/messagedeleted.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/messageedited.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/messageread.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/newmessage.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/raw.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/events/userupdate.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/binaryreader.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/html.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/markdown.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/extensions/messagepacker.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/filters.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/functions.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/helpers.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/hints.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/authenticator.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/connection.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/http.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpabridged.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpfull.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpintermediate.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpmtproxy.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/tcpobfuscated.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/connection/websocket.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/mtprotoplainsender.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/mtprotosender.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/mtprotostate.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/network/requeststate.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/password.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/requestiter.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/resolvers.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/abstract.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/sqlite.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sessions/string.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/sync.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/alltlobjects.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/gzippacked.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/messagecontainer.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/rpcresult.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/core/tlmessage.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/adminlogevent.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/button.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/chatgetter.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/conversation.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/dialog.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/draft.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/file.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/forward.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/inputsizedfile.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/message.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/messagebutton.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/participantpermissions.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/qrlogin.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/sendergetter.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/custom/types.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/account.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/auth.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/bots.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/channels.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/chatlists.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/conference.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/contacts.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/folders.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/help.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/langpack.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/messages.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/payments.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/phone.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/photos.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/premium.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/stats.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/stories.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/thirdParty.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/updates.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/upload.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/functions/users.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/patched/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/tlobject.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/__init__.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/account.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/auth.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/bots.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/channels.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/chatlists.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/conference.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/contacts.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/help.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/messages.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/payments.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/phone.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/photos.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/premium.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/stats.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/stickers.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/storage.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/stories.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/thirdParty.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/update.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/updates.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/upload.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy/tl/types/users.py +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/SOURCES.txt +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/dependency_links.txt +0 -0
- {spluspy-2.2.8 → spluspy-2.2.9}/spluspy.egg-info/requires.txt +0 -0
- {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.
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
|
@@ -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
|
-
|
|
514
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
-
|
|
1046
|
-
|
|
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,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spluspy
|
|
3
|
-
Version: 2.2.
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|