spluspy 2.0.0__tar.gz → 2.0.2__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.0.2/CHANGELOG.md +53 -0
- spluspy-2.0.2/CONTRIBUTING.md +81 -0
- spluspy-2.0.2/LICENSE +21 -0
- spluspy-2.0.2/MANIFEST.in +7 -0
- spluspy-2.0.2/PKG-INFO +324 -0
- spluspy-2.0.2/README.md +279 -0
- spluspy-2.0.2/README.rst +76 -0
- spluspy-2.0.2/examples/01_hello_bot.py +18 -0
- spluspy-2.0.2/examples/02_echo_bot.py +19 -0
- spluspy-2.0.2/examples/03_command_bot.py +31 -0
- spluspy-2.0.2/examples/04_private_only.py +19 -0
- spluspy-2.0.2/examples/05_group_only.py +19 -0
- spluspy-2.0.2/examples/06_regex_bot.py +26 -0
- spluspy-2.0.2/examples/07_user_filter.py +28 -0
- spluspy-2.0.2/examples/08_combined_filters.py +31 -0
- spluspy-2.0.2/examples/09_inline_keyboard.py +37 -0
- spluspy-2.0.2/examples/10_reply_keyboard.py +35 -0
- spluspy-2.0.2/examples/11_message_actions.py +41 -0
- spluspy-2.0.2/examples/12_media_bot.py +38 -0
- spluspy-2.0.2/examples/13_fsm_bot.py +63 -0
- spluspy-2.0.2/examples/14_plugin_bot.py +36 -0
- spluspy-2.0.2/examples/15_middleware_bot.py +41 -0
- spluspy-2.0.2/examples/16_scheduler_bot.py +34 -0
- spluspy-2.0.2/examples/17_conversation.py +26 -0
- spluspy-2.0.2/examples/18_chat_management.py +49 -0
- spluspy-2.0.2/examples/19_event_types.py +61 -0
- spluspy-2.0.2/examples/20_sync_bot.py +25 -0
- spluspy-2.0.2/examples/21_album_handler.py +19 -0
- spluspy-2.0.2/examples/22_download_bot.py +26 -0
- spluspy-2.0.2/examples/23_url_button.py +25 -0
- spluspy-2.0.2/examples/24_string_session.py +34 -0
- spluspy-2.0.2/examples/25_error_handling.py +30 -0
- spluspy-2.0.2/examples/25_working_bot.py +63 -0
- spluspy-2.0.2/examples/26_message_entities.py +33 -0
- spluspy-2.0.2/examples/27_search_messages.py +29 -0
- spluspy-2.0.2/examples/28_poll_bot.py +24 -0
- spluspy-2.0.2/examples/29_dice_bot.py +31 -0
- spluspy-2.0.2/examples/30_cache_bot.py +27 -0
- spluspy-2.0.2/examples/31_reaction_bot.py +31 -0
- spluspy-2.0.2/examples/32_mark_read_bot.py +27 -0
- spluspy-2.0.2/examples/33_context_manager.py +22 -0
- spluspy-2.0.2/examples/34_user_info.py +23 -0
- spluspy-2.0.2/examples/35_chat_info.py +24 -0
- spluspy-2.0.2/examples/36_forward_copy.py +33 -0
- spluspy-2.0.2/examples/37_admin_bot.py +53 -0
- spluspy-2.0.2/examples/38_media_filters.py +38 -0
- spluspy-2.0.2/examples/39_status_bot.py +21 -0
- spluspy-2.0.2/examples/40_delete_detection.py +19 -0
- spluspy-2.0.2/examples/41_read_detection.py +19 -0
- spluspy-2.0.2/examples/42_raw_events.py +18 -0
- spluspy-2.0.2/examples/43_poll_handler.py +19 -0
- spluspy-2.0.2/examples/44_reaction_handler.py +18 -0
- spluspy-2.0.2/examples/45_typing_handler.py +18 -0
- spluspy-2.0.2/examples/46_get_messages.py +30 -0
- spluspy-2.0.2/examples/47_iter_messages.py +22 -0
- spluspy-2.0.2/examples/48_get_members.py +21 -0
- spluspy-2.0.2/examples/49_resolve_username.py +24 -0
- spluspy-2.0.2/examples/50_invoke.py +20 -0
- spluspy-2.0.2/pyproject.toml +124 -0
- spluspy-2.0.2/spluspy/__init__.py +59 -0
- spluspy-2.0.2/spluspy/__version__.py +7 -0
- spluspy-2.0.2/spluspy/client/__init__.py +5 -0
- spluspy-2.0.2/spluspy/client/client.py +688 -0
- spluspy-2.0.2/spluspy/client/conversation.py +80 -0
- spluspy-2.0.2/spluspy/compat.py +51 -0
- spluspy-2.0.2/spluspy/config.py +117 -0
- spluspy-2.0.2/spluspy/errors/__init__.py +39 -0
- spluspy-2.0.2/spluspy/errors/exceptions.py +76 -0
- spluspy-2.0.2/spluspy/events/__init__.py +26 -0
- spluspy-2.0.2/spluspy/events/album.py +57 -0
- spluspy-2.0.2/spluspy/events/base.py +75 -0
- spluspy-2.0.2/spluspy/events/callback.py +61 -0
- spluspy-2.0.2/spluspy/events/chat_action.py +113 -0
- spluspy-2.0.2/spluspy/events/edited.py +46 -0
- spluspy-2.0.2/spluspy/events/inline.py +52 -0
- spluspy-2.0.2/spluspy/events/message.py +247 -0
- spluspy-2.0.2/spluspy/events/message_deleted.py +42 -0
- spluspy-2.0.2/spluspy/events/message_read.py +41 -0
- spluspy-2.0.2/spluspy/events/user_update.py +54 -0
- spluspy-2.0.2/spluspy/filters/__init__.py +66 -0
- spluspy-2.0.2/spluspy/filters/filters.py +255 -0
- spluspy-2.0.2/spluspy/fsm/__init__.py +5 -0
- spluspy-2.0.2/spluspy/fsm/state.py +146 -0
- spluspy-2.0.2/spluspy/middleware/__init__.py +5 -0
- spluspy-2.0.2/spluspy/middleware/base.py +101 -0
- spluspy-2.0.2/spluspy/network/__init__.py +15 -0
- spluspy-2.0.2/spluspy/network/client.py +257 -0
- spluspy-2.0.2/spluspy/network/connection.py +167 -0
- spluspy-2.0.2/spluspy/network/mtproto.py +481 -0
- spluspy-2.0.2/spluspy/network/spluspy_adapter.py +133 -0
- spluspy-2.0.2/spluspy/network/telethon_adapter.py +153 -0
- spluspy-2.0.2/spluspy/network/transport.py +282 -0
- spluspy-2.0.2/spluspy/plugins/__init__.py +5 -0
- spluspy-2.0.2/spluspy/plugins/loader.py +150 -0
- spluspy-2.0.2/spluspy/scheduler/__init__.py +5 -0
- spluspy-2.0.2/spluspy/scheduler/scheduler.py +151 -0
- spluspy-2.0.2/spluspy/session/__init__.py +13 -0
- spluspy-2.0.2/spluspy/session/base.py +70 -0
- spluspy-2.0.2/spluspy/session/memory.py +58 -0
- spluspy-2.0.2/spluspy/session/sqlite.py +112 -0
- spluspy-2.0.2/spluspy/session/string.py +87 -0
- spluspy-2.0.2/spluspy/storage/__init__.py +11 -0
- spluspy-2.0.2/spluspy/storage/base.py +39 -0
- spluspy-2.0.2/spluspy/storage/memory.py +52 -0
- spluspy-2.0.2/spluspy/storage/sqlite.py +115 -0
- spluspy-2.0.2/spluspy/sync/__init__.py +17 -0
- spluspy-2.0.2/spluspy/sync/client.py +267 -0
- spluspy-2.0.2/spluspy/types/__init__.py +66 -0
- spluspy-2.0.2/spluspy/types/bot.py +254 -0
- spluspy-2.0.2/spluspy/types/chat.py +103 -0
- spluspy-2.0.2/spluspy/types/enums.py +63 -0
- spluspy-2.0.2/spluspy/types/media.py +227 -0
- spluspy-2.0.2/spluspy/types/message.py +347 -0
- spluspy-2.0.2/spluspy/types/objects.py +110 -0
- spluspy-2.0.2/spluspy/types/user.py +88 -0
- spluspy-2.0.2/spluspy/utils/__init__.py +25 -0
- spluspy-2.0.2/spluspy/utils/cache.py +86 -0
- spluspy-2.0.2/spluspy/utils/helpers.py +62 -0
- spluspy-2.0.2/spluspy/utils/logger.py +284 -0
- spluspy-2.0.2/tempCodeRunnerFile.py +6 -0
- spluspy-2.0.2/test_handlers.py +85 -0
- spluspy-2.0.2/testbots/hello_bot.py +16 -0
- spluspy-2.0.2/tests/.vscode/PythonImportHelper-v2-Completion.json +843 -0
- spluspy-2.0.2/tests/__init__.py +1 -0
- spluspy-2.0.2/tests/test_client.py +141 -0
- spluspy-2.0.2/tests/test_filters.py +194 -0
- spluspy-2.0.2/tests/test_fsm.py +92 -0
- spluspy-2.0.2/tests/test_middleware.py +67 -0
- spluspy-2.0.2/tests/test_scheduler.py +68 -0
- spluspy-2.0.2/tests/test_session.py +84 -0
- spluspy-2.0.2/tests/test_storage.py +82 -0
- spluspy-2.0.2/tests/test_types.py +171 -0
- spluspy-2.0.2/tests/test_utils.py +90 -0
- spluspy-2.0.0/PKG-INFO +0 -173
- spluspy-2.0.0/README.rst +0 -133
- spluspy-2.0.0/setup.cfg +0 -4
- spluspy-2.0.0/setup.py +0 -258
- spluspy-2.0.0/spluspy/__init__.py +0 -22
- spluspy-2.0.0/spluspy/_updates/__init__.py +0 -3
- spluspy-2.0.0/spluspy/_updates/entitycache.py +0 -59
- spluspy-2.0.0/spluspy/_updates/messagebox.py +0 -826
- spluspy-2.0.0/spluspy/_updates/session.py +0 -195
- spluspy-2.0.0/spluspy/client/__init__.py +0 -25
- spluspy-2.0.0/spluspy/client/account.py +0 -243
- spluspy-2.0.0/spluspy/client/auth.py +0 -721
- spluspy-2.0.0/spluspy/client/bots.py +0 -72
- spluspy-2.0.0/spluspy/client/buttons.py +0 -101
- spluspy-2.0.0/spluspy/client/chats.py +0 -1582
- spluspy-2.0.0/spluspy/client/dialogs.py +0 -606
- spluspy-2.0.0/spluspy/client/downloads.py +0 -1092
- spluspy-2.0.0/spluspy/client/messageparse.py +0 -233
- spluspy-2.0.0/spluspy/client/messages.py +0 -1524
- spluspy-2.0.0/spluspy/client/ratelimiter.py +0 -188
- spluspy-2.0.0/spluspy/client/soroushclient.py +0 -997
- spluspy-2.0.0/spluspy/client/telegrambaseclient.py +0 -1081
- spluspy-2.0.0/spluspy/client/updates.py +0 -724
- spluspy-2.0.0/spluspy/client/uploads.py +0 -867
- spluspy-2.0.0/spluspy/client/users.py +0 -632
- spluspy-2.0.0/spluspy/crypto/__init__.py +0 -10
- spluspy-2.0.0/spluspy/crypto/aes.py +0 -225
- spluspy-2.0.0/spluspy/crypto/aesctr.py +0 -130
- spluspy-2.0.0/spluspy/crypto/authkey.py +0 -63
- spluspy-2.0.0/spluspy/crypto/cdndecrypter.py +0 -109
- spluspy-2.0.0/spluspy/crypto/factorization.py +0 -67
- spluspy-2.0.0/spluspy/crypto/libssl.py +0 -138
- spluspy-2.0.0/spluspy/crypto/rsa.py +0 -268
- spluspy-2.0.0/spluspy/custom.py +0 -1
- spluspy-2.0.0/spluspy/errors/__init__.py +0 -46
- spluspy-2.0.0/spluspy/errors/common.py +0 -180
- spluspy-2.0.0/spluspy/errors/rpcbaseerrors.py +0 -135
- spluspy-2.0.0/spluspy/errors/rpcerrorlist.py +0 -5356
- spluspy-2.0.0/spluspy/events/__init__.py +0 -150
- spluspy-2.0.0/spluspy/events/album.py +0 -343
- spluspy-2.0.0/spluspy/events/callbackquery.py +0 -345
- spluspy-2.0.0/spluspy/events/chataction.py +0 -458
- spluspy-2.0.0/spluspy/events/common.py +0 -186
- spluspy-2.0.0/spluspy/events/decorators.py +0 -362
- spluspy-2.0.0/spluspy/events/inlinequery.py +0 -247
- spluspy-2.0.0/spluspy/events/messagedeleted.py +0 -57
- spluspy-2.0.0/spluspy/events/messageedited.py +0 -52
- spluspy-2.0.0/spluspy/events/messageread.py +0 -143
- spluspy-2.0.0/spluspy/events/newmessage.py +0 -223
- spluspy-2.0.0/spluspy/events/raw.py +0 -53
- spluspy-2.0.0/spluspy/events/userupdate.py +0 -310
- spluspy-2.0.0/spluspy/extensions/__init__.py +0 -6
- spluspy-2.0.0/spluspy/extensions/binaryreader.py +0 -207
- spluspy-2.0.0/spluspy/extensions/html.py +0 -203
- spluspy-2.0.0/spluspy/extensions/markdown.py +0 -193
- spluspy-2.0.0/spluspy/extensions/messagepacker.py +0 -122
- spluspy-2.0.0/spluspy/functions.py +0 -1
- spluspy-2.0.0/spluspy/helpers.py +0 -515
- spluspy-2.0.0/spluspy/hints.py +0 -72
- spluspy-2.0.0/spluspy/network/__init__.py +0 -14
- spluspy-2.0.0/spluspy/network/authenticator.py +0 -212
- spluspy-2.0.0/spluspy/network/connection/__init__.py +0 -13
- spluspy-2.0.0/spluspy/network/connection/connection.py +0 -440
- spluspy-2.0.0/spluspy/network/connection/http.py +0 -39
- spluspy-2.0.0/spluspy/network/connection/tcpabridged.py +0 -33
- spluspy-2.0.0/spluspy/network/connection/tcpfull.py +0 -58
- spluspy-2.0.0/spluspy/network/connection/tcpintermediate.py +0 -46
- spluspy-2.0.0/spluspy/network/connection/tcpmtproxy.py +0 -165
- spluspy-2.0.0/spluspy/network/connection/tcpobfuscated.py +0 -62
- spluspy-2.0.0/spluspy/network/connection/websocket.py +0 -186
- spluspy-2.0.0/spluspy/network/mtprotoplainsender.py +0 -56
- spluspy-2.0.0/spluspy/network/mtprotosender.py +0 -932
- spluspy-2.0.0/spluspy/network/mtprotostate.py +0 -285
- spluspy-2.0.0/spluspy/network/requeststate.py +0 -19
- spluspy-2.0.0/spluspy/password.py +0 -194
- spluspy-2.0.0/spluspy/requestiter.py +0 -134
- spluspy-2.0.0/spluspy/sessions/__init__.py +0 -4
- spluspy-2.0.0/spluspy/sessions/abstract.py +0 -172
- spluspy-2.0.0/spluspy/sessions/memory.py +0 -263
- spluspy-2.0.0/spluspy/sessions/sqlite.py +0 -388
- spluspy-2.0.0/spluspy/sessions/string.py +0 -75
- spluspy-2.0.0/spluspy/sync.py +0 -74
- spluspy-2.0.0/spluspy/tl/__init__.py +0 -1
- spluspy-2.0.0/spluspy/tl/alltlobjects.py +0 -1696
- spluspy-2.0.0/spluspy/tl/core/__init__.py +0 -26
- spluspy-2.0.0/spluspy/tl/core/gzippacked.py +0 -48
- spluspy-2.0.0/spluspy/tl/core/messagecontainer.py +0 -47
- spluspy-2.0.0/spluspy/tl/core/rpcresult.py +0 -35
- spluspy-2.0.0/spluspy/tl/core/tlmessage.py +0 -34
- spluspy-2.0.0/spluspy/tl/custom/__init__.py +0 -14
- spluspy-2.0.0/spluspy/tl/custom/adminlogevent.py +0 -475
- spluspy-2.0.0/spluspy/tl/custom/button.py +0 -346
- spluspy-2.0.0/spluspy/tl/custom/chatgetter.py +0 -150
- spluspy-2.0.0/spluspy/tl/custom/conversation.py +0 -529
- spluspy-2.0.0/spluspy/tl/custom/dialog.py +0 -161
- spluspy-2.0.0/spluspy/tl/custom/draft.py +0 -191
- spluspy-2.0.0/spluspy/tl/custom/file.py +0 -146
- spluspy-2.0.0/spluspy/tl/custom/forward.py +0 -51
- spluspy-2.0.0/spluspy/tl/custom/inlinebuilder.py +0 -450
- spluspy-2.0.0/spluspy/tl/custom/inlineresult.py +0 -176
- spluspy-2.0.0/spluspy/tl/custom/inlineresults.py +0 -83
- spluspy-2.0.0/spluspy/tl/custom/inputsizedfile.py +0 -9
- spluspy-2.0.0/spluspy/tl/custom/message.py +0 -1243
- spluspy-2.0.0/spluspy/tl/custom/messagebutton.py +0 -154
- spluspy-2.0.0/spluspy/tl/custom/participantpermissions.py +0 -138
- spluspy-2.0.0/spluspy/tl/custom/qrlogin.py +0 -119
- spluspy-2.0.0/spluspy/tl/custom/sendergetter.py +0 -102
- spluspy-2.0.0/spluspy/tl/custom/types.py +0 -38
- spluspy-2.0.0/spluspy/tl/functions/__init__.py +0 -452
- spluspy-2.0.0/spluspy/tl/functions/account.py +0 -1581
- spluspy-2.0.0/spluspy/tl/functions/auth.py +0 -593
- spluspy-2.0.0/spluspy/tl/functions/bots.py +0 -112
- spluspy-2.0.0/spluspy/tl/functions/channels.py +0 -1672
- spluspy-2.0.0/spluspy/tl/functions/chatlists.py +0 -325
- spluspy-2.0.0/spluspy/tl/functions/conference.py +0 -437
- spluspy-2.0.0/spluspy/tl/functions/contacts.py +0 -476
- spluspy-2.0.0/spluspy/tl/functions/folders.py +0 -44
- spluspy-2.0.0/spluspy/tl/functions/help.py +0 -259
- spluspy-2.0.0/spluspy/tl/functions/langpack.py +0 -146
- spluspy-2.0.0/spluspy/tl/functions/messages.py +0 -5469
- spluspy-2.0.0/spluspy/tl/functions/payments.py +0 -292
- spluspy-2.0.0/spluspy/tl/functions/phone.py +0 -809
- spluspy-2.0.0/spluspy/tl/functions/photos.py +0 -282
- spluspy-2.0.0/spluspy/tl/functions/premium.py +0 -152
- spluspy-2.0.0/spluspy/tl/functions/stats.py +0 -300
- spluspy-2.0.0/spluspy/tl/functions/stories.py +0 -765
- spluspy-2.0.0/spluspy/tl/functions/thirdParty.py +0 -67
- spluspy-2.0.0/spluspy/tl/functions/updates.py +0 -139
- spluspy-2.0.0/spluspy/tl/functions/upload.py +0 -168
- spluspy-2.0.0/spluspy/tl/functions/users.py +0 -170
- spluspy-2.0.0/spluspy/tl/patched/__init__.py +0 -20
- spluspy-2.0.0/spluspy/tl/tlobject.py +0 -222
- spluspy-2.0.0/spluspy/tl/types/__init__.py +0 -40015
- spluspy-2.0.0/spluspy/tl/types/account.py +0 -1096
- spluspy-2.0.0/spluspy/tl/types/auth.py +0 -809
- spluspy-2.0.0/spluspy/tl/types/bots.py +0 -43
- spluspy-2.0.0/spluspy/tl/types/channels.py +0 -232
- spluspy-2.0.0/spluspy/tl/types/chatlists.py +0 -273
- spluspy-2.0.0/spluspy/tl/types/conference.py +0 -69
- spluspy-2.0.0/spluspy/tl/types/contacts.py +0 -478
- spluspy-2.0.0/spluspy/tl/types/help.py +0 -1206
- spluspy-2.0.0/spluspy/tl/types/messages.py +0 -3000
- spluspy-2.0.0/spluspy/tl/types/payments.py +0 -633
- spluspy-2.0.0/spluspy/tl/types/phone.py +0 -313
- spluspy-2.0.0/spluspy/tl/types/photos.py +0 -135
- spluspy-2.0.0/spluspy/tl/types/premium.py +0 -209
- spluspy-2.0.0/spluspy/tl/types/stats.py +0 -368
- spluspy-2.0.0/spluspy/tl/types/stickers.py +0 -35
- spluspy-2.0.0/spluspy/tl/types/storage.py +0 -197
- spluspy-2.0.0/spluspy/tl/types/stories.py +0 -317
- spluspy-2.0.0/spluspy/tl/types/thirdParty.py +0 -94
- spluspy-2.0.0/spluspy/tl/types/update.py +0 -39
- spluspy-2.0.0/spluspy/tl/types/updates.py +0 -447
- spluspy-2.0.0/spluspy/tl/types/upload.py +0 -196
- spluspy-2.0.0/spluspy/tl/types/users.py +0 -131
- spluspy-2.0.0/spluspy/types.py +0 -1
- spluspy-2.0.0/spluspy/updater.py +0 -72
- spluspy-2.0.0/spluspy/utils.py +0 -1593
- spluspy-2.0.0/spluspy/version.py +0 -3
- spluspy-2.0.0/spluspy.egg-info/PKG-INFO +0 -173
- spluspy-2.0.0/spluspy.egg-info/SOURCES.txt +0 -162
- spluspy-2.0.0/spluspy.egg-info/dependency_links.txt +0 -1
- spluspy-2.0.0/spluspy.egg-info/requires.txt +0 -6
- spluspy-2.0.0/spluspy.egg-info/top_level.txt +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to SplusPy will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [2.0.0] - 2024-01-01
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Complete rewrite from scratch with clean architecture
|
|
13
|
+
- Async-first design with full type hints
|
|
14
|
+
- Synchronous client wrapper (`spluspy.sync`)
|
|
15
|
+
- Composable filter system (`filters.text & filters.private`)
|
|
16
|
+
- FSM (Finite State Machine) for conversational bots
|
|
17
|
+
- Plugin system with dynamic loading
|
|
18
|
+
- Middleware system for pre/post processing
|
|
19
|
+
- Task scheduler
|
|
20
|
+
- Multiple storage backends (Memory, SQLite)
|
|
21
|
+
- Professional logging system
|
|
22
|
+
- Connection pool with auto-reconnect
|
|
23
|
+
- LRU cache
|
|
24
|
+
- 100+ examples
|
|
25
|
+
- Full test suite with pytest
|
|
26
|
+
- CI/CD with GitHub Actions
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- Complete API redesign inspired by Telethon/Pyrogram
|
|
31
|
+
- Message objects now have methods (reply, edit, delete, etc.)
|
|
32
|
+
- Event system uses builder pattern
|
|
33
|
+
- Session system supports SQLite, Memory, and String sessions
|
|
34
|
+
- Exception hierarchy with specific error types
|
|
35
|
+
|
|
36
|
+
### Removed
|
|
37
|
+
|
|
38
|
+
- Legacy Telethon-forked code
|
|
39
|
+
- Monolithic architecture
|
|
40
|
+
- Untyped code
|
|
41
|
+
|
|
42
|
+
## [1.0.1] - 2023-12-01
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Minor bug fixes
|
|
47
|
+
|
|
48
|
+
## [1.0.0] - 2023-11-01
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- Initial release as a Telethon fork
|
|
53
|
+
- Basic Soroush Plus support
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Contributing to SplusPy
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to SplusPy! This document provides guidelines and information for contributors.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
1. Fork the repository on GitHub
|
|
8
|
+
2. Clone your fork locally:
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/your-username/spluspy.git
|
|
11
|
+
cd spluspy
|
|
12
|
+
```
|
|
13
|
+
3. Create a virtual environment:
|
|
14
|
+
```bash
|
|
15
|
+
python -m venv venv
|
|
16
|
+
source venv/bin/activate # Linux/Mac
|
|
17
|
+
# or
|
|
18
|
+
venv\Scripts\activate # Windows
|
|
19
|
+
```
|
|
20
|
+
4. Install development dependencies:
|
|
21
|
+
```bash
|
|
22
|
+
pip install -e ".[dev]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Development Workflow
|
|
26
|
+
|
|
27
|
+
1. Create a feature branch:
|
|
28
|
+
```bash
|
|
29
|
+
git checkout -b feature/your-feature-name
|
|
30
|
+
```
|
|
31
|
+
2. Make your changes
|
|
32
|
+
3. Run the linter:
|
|
33
|
+
```bash
|
|
34
|
+
ruff check spluspy/
|
|
35
|
+
```
|
|
36
|
+
4. Run the formatter:
|
|
37
|
+
```bash
|
|
38
|
+
black spluspy/
|
|
39
|
+
```
|
|
40
|
+
5. Run type checker:
|
|
41
|
+
```bash
|
|
42
|
+
mypy spluspy/
|
|
43
|
+
```
|
|
44
|
+
6. Run tests:
|
|
45
|
+
```bash
|
|
46
|
+
pytest
|
|
47
|
+
```
|
|
48
|
+
7. Commit your changes with a clear message
|
|
49
|
+
8. Push to your fork and create a pull request
|
|
50
|
+
|
|
51
|
+
## Code Style
|
|
52
|
+
|
|
53
|
+
- Follow PEP 8
|
|
54
|
+
- Use type hints for all functions and methods
|
|
55
|
+
- Write docstrings for public APIs
|
|
56
|
+
- Keep functions focused and small
|
|
57
|
+
- Use meaningful variable and function names
|
|
58
|
+
|
|
59
|
+
## Testing
|
|
60
|
+
|
|
61
|
+
- Write tests for new features
|
|
62
|
+
- Ensure all tests pass before submitting a PR
|
|
63
|
+
- Aim for high test coverage
|
|
64
|
+
|
|
65
|
+
## Pull Request Guidelines
|
|
66
|
+
|
|
67
|
+
- Provide a clear description of the changes
|
|
68
|
+
- Reference any related issues
|
|
69
|
+
- Include tests for new functionality
|
|
70
|
+
- Update documentation if needed
|
|
71
|
+
|
|
72
|
+
## Reporting Issues
|
|
73
|
+
|
|
74
|
+
- Use the GitHub issue tracker
|
|
75
|
+
- Include steps to reproduce the issue
|
|
76
|
+
- Include your Python version and OS
|
|
77
|
+
- Include error messages and stack traces
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
spluspy-2.0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ali Mirshekari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
spluspy-2.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spluspy
|
|
3
|
+
Version: 2.0.2
|
|
4
|
+
Summary: A modern async Python library for interacting with Soroush Plus
|
|
5
|
+
Project-URL: Homepage, https://github.com/Itskillmaster/spluspy
|
|
6
|
+
Project-URL: Documentation, https://github.com/Itskillmaster/spluspy#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/Itskillmaster/spluspy
|
|
8
|
+
Project-URL: Issues, https://github.com/Itskillmaster/spluspy/issues
|
|
9
|
+
Author: Ali Mirshekari
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: async,bot,mtproto,soroush,splus,userbot
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Communications :: Chat
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Requires-Dist: aiosqlite>=0.19.0
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: black>=23.0; extra == 'all'
|
|
29
|
+
Requires-Dist: cryptg; extra == 'all'
|
|
30
|
+
Requires-Dist: mypy>=1.0; extra == 'all'
|
|
31
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'all'
|
|
32
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'all'
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == 'all'
|
|
34
|
+
Requires-Dist: ruff>=0.1.0; extra == 'all'
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: black>=23.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
42
|
+
Provides-Extra: speed
|
|
43
|
+
Requires-Dist: cryptg; extra == 'speed'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# SplusPy
|
|
47
|
+
|
|
48
|
+
<p align="center">
|
|
49
|
+
<strong>A modern async Python library for Soroush Plus</strong>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<p align="center">
|
|
53
|
+
<a href="https://github.com/Itskillmaster/spluspy/blob/main/LICENSE">
|
|
54
|
+
<img src="https://img.shields.io/badge/License-MIT-green" alt="License">
|
|
55
|
+
</a>
|
|
56
|
+
<a href="https://pypi.org/project/spluspy/">
|
|
57
|
+
<img src="https://img.shields.io/pypi/v/spluspy" alt="PyPI">
|
|
58
|
+
</a>
|
|
59
|
+
<a href="https://pypi.org/project/spluspy/">
|
|
60
|
+
<img src="https://img.shields.io/pypi/pyversions/spluspy" alt="Python">
|
|
61
|
+
</a>
|
|
62
|
+
</p>
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## What is SplusPy?
|
|
67
|
+
|
|
68
|
+
**SplusPy** is a modern, asynchronous Python library for interacting with [Soroush Plus](https://web.splus.ir) — both as a user account and a bot account.
|
|
69
|
+
|
|
70
|
+
Built from the ground up with clean architecture, it's designed to feel like [Telethon](https://github.com/LonamiWebs/Telethon) or [Pyrogram](https://github.com/pyrogram/pyrogram), but specifically for the Soroush Plus ecosystem.
|
|
71
|
+
|
|
72
|
+
## Features
|
|
73
|
+
|
|
74
|
+
- **No API Key Required** — Built-in Soroush Plus credentials
|
|
75
|
+
- **Fully Asynchronous** — Built with Python's `asyncio`
|
|
76
|
+
- **Sync Support** — Use without `async/await` via `spluspy.sync`
|
|
77
|
+
- **Bot & User Support** — Both account types
|
|
78
|
+
- **Event-Driven Handlers** — Powerful event system with decorators
|
|
79
|
+
- **Filter System** — Composable filters (`&`, `|`, `~`)
|
|
80
|
+
- **Inline & Reply Buttons** — Interactive keyboards
|
|
81
|
+
- **Conversation API** — For interactive bot flows
|
|
82
|
+
- **FSM (Finite State Machine)** — Built-in state management for bots
|
|
83
|
+
- **Plugin System** — Dynamic plugin loading
|
|
84
|
+
- **Middleware** — Pre/post processing of updates
|
|
85
|
+
- **Scheduler** — Built-in task scheduler
|
|
86
|
+
- **Multiple Storage Backends** — Memory, SQLite
|
|
87
|
+
- **Professional Logging** — Structured, namespaced loggers
|
|
88
|
+
- **Type Hints Everywhere** — Full type safety
|
|
89
|
+
- **Clean Architecture** — SOLID principles, modular design
|
|
90
|
+
|
|
91
|
+
## Installation
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install spluspy
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For faster encryption:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pip install spluspy[speed]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Quick Start
|
|
104
|
+
|
|
105
|
+
### Simplest Bot
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from spluspy import Client
|
|
109
|
+
|
|
110
|
+
bot = Client("my_session")
|
|
111
|
+
|
|
112
|
+
@bot.on_message()
|
|
113
|
+
async def handler(m):
|
|
114
|
+
await m.reply("Hello!")
|
|
115
|
+
|
|
116
|
+
bot.run()
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### User Account
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from spluspy import Client
|
|
123
|
+
|
|
124
|
+
client = Client("session_name")
|
|
125
|
+
|
|
126
|
+
@client.on_message()
|
|
127
|
+
async def handler(m):
|
|
128
|
+
await m.reply("Hey there!")
|
|
129
|
+
|
|
130
|
+
async def main():
|
|
131
|
+
await client.start(phone="+98XXXXXXXXXX")
|
|
132
|
+
await client.run_until_disconnected()
|
|
133
|
+
|
|
134
|
+
import asyncio
|
|
135
|
+
asyncio.run(main())
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Sync Usage (No Async/Await)
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
from spluspy.sync import Client
|
|
142
|
+
|
|
143
|
+
bot = Client("session")
|
|
144
|
+
|
|
145
|
+
@bot.on_message()
|
|
146
|
+
def handler(m):
|
|
147
|
+
m.reply("Hello!")
|
|
148
|
+
|
|
149
|
+
bot.run()
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Events
|
|
153
|
+
|
|
154
|
+
| Decorator | Event |
|
|
155
|
+
|-----------|-------|
|
|
156
|
+
| `@bot.on_message()` | New message |
|
|
157
|
+
| `@bot.on_edited()` | Message edited |
|
|
158
|
+
| `@bot.on_callback_query()` | Inline button clicked |
|
|
159
|
+
| `@bot.on_inline_query()` | Inline query |
|
|
160
|
+
| `@bot.on_chat_action()` | Join/leave/pin |
|
|
161
|
+
| `@bot.on_user_update()` | Status change |
|
|
162
|
+
| `@bot.on_message_deleted()` | Message deleted |
|
|
163
|
+
| `@bot.on_message_read()` | Read receipt |
|
|
164
|
+
|
|
165
|
+
## Filters
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
from spluspy import filters
|
|
169
|
+
|
|
170
|
+
@bot.on_message(filters.text) # Text only
|
|
171
|
+
@bot.on_message(filters.private) # Private chats
|
|
172
|
+
@bot.on_message(filters.group) # Groups
|
|
173
|
+
@bot.on_message(filters.command("start")) # /start command
|
|
174
|
+
@bot.on_message(filters.regex(r"\d+")) # Regex match
|
|
175
|
+
@bot.on_message(filters.user(123)) # Specific user
|
|
176
|
+
@bot.on_message(filters.text & filters.private) # Combined
|
|
177
|
+
@bot.on_message(filters.photo | filters.video) # Photo OR video
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Message Methods
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
await m.reply("Hello") # Reply
|
|
184
|
+
await m.edit("New text") # Edit
|
|
185
|
+
await m.delete() # Delete
|
|
186
|
+
await m.forward(chat_id) # Forward
|
|
187
|
+
await m.copy(chat_id) # Copy (no forward header)
|
|
188
|
+
await m.pin() # Pin
|
|
189
|
+
await m.react("❤️") # React
|
|
190
|
+
await m.mark_read() # Mark as read
|
|
191
|
+
await m.download() # Download media
|
|
192
|
+
await m.reply_photo("photo.jpg") # Reply with photo
|
|
193
|
+
await m.reply_video("video.mp4") # Reply with video
|
|
194
|
+
await m.reply_document("file.pdf") # Reply with document
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Buttons
|
|
198
|
+
|
|
199
|
+
```python
|
|
200
|
+
from spluspy import Button
|
|
201
|
+
|
|
202
|
+
# Inline keyboard
|
|
203
|
+
keyboard = Button.build_inline(
|
|
204
|
+
[Button.inline("Option 1", b"opt1"), Button.inline("Option 2", b"opt2")]
|
|
205
|
+
)
|
|
206
|
+
await bot.send_message(chat_id, "Choose:", buttons=keyboard)
|
|
207
|
+
|
|
208
|
+
# Reply keyboard
|
|
209
|
+
kb = Button.build_reply(
|
|
210
|
+
[Button.text("Menu"), Button.text("Settings")]
|
|
211
|
+
)
|
|
212
|
+
await bot.send_message(chat_id, "Pick:", buttons=kb)
|
|
213
|
+
|
|
214
|
+
# Clear keyboard
|
|
215
|
+
await bot.send_message(chat_id, "Done", buttons=Button.clear())
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## FSM (State Machine)
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
from spluspy.fsm import State, StateMachine
|
|
222
|
+
from spluspy.storage import MemoryStorage
|
|
223
|
+
|
|
224
|
+
storage = MemoryStorage()
|
|
225
|
+
fsm = StateMachine(storage)
|
|
226
|
+
|
|
227
|
+
class Form:
|
|
228
|
+
name = State()
|
|
229
|
+
age = State()
|
|
230
|
+
|
|
231
|
+
@bot.on_message(filters.command("register"))
|
|
232
|
+
async def start_register(m):
|
|
233
|
+
ctx = fsm.context(m.sender_id)
|
|
234
|
+
await ctx.set_state(Form.name)
|
|
235
|
+
await m.reply("What is your name?")
|
|
236
|
+
|
|
237
|
+
@bot.on_message(filters.private)
|
|
238
|
+
async def process_form(m):
|
|
239
|
+
ctx = fsm.context(m.sender_id)
|
|
240
|
+
state = await ctx.get_state()
|
|
241
|
+
|
|
242
|
+
if state == Form.name:
|
|
243
|
+
await ctx.set_data(name=m.text)
|
|
244
|
+
await ctx.set_state(Form.age)
|
|
245
|
+
await m.reply("How old are you?")
|
|
246
|
+
elif state == Form.age:
|
|
247
|
+
await ctx.set_data(age=m.text)
|
|
248
|
+
await ctx.reset()
|
|
249
|
+
await m.reply(f"Registered! Name: {(await ctx.get_data()).get('name')}")
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Plugin System
|
|
253
|
+
|
|
254
|
+
```python
|
|
255
|
+
# plugins/hello.py
|
|
256
|
+
def register(client):
|
|
257
|
+
@client.on_message(filters.command("hello"))
|
|
258
|
+
async def hello_handler(m):
|
|
259
|
+
await m.reply("Hello from plugin!")
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
```python
|
|
263
|
+
# main.py
|
|
264
|
+
from spluspy import Client
|
|
265
|
+
|
|
266
|
+
bot = Client("session")
|
|
267
|
+
bot.plugins.load("plugins")
|
|
268
|
+
bot.run()
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Chat Management
|
|
272
|
+
|
|
273
|
+
```python
|
|
274
|
+
await bot.ban_user(chat_id, user_id)
|
|
275
|
+
await bot.unban_user(chat_id, user_id)
|
|
276
|
+
await bot.mute_user(chat_id, user_id)
|
|
277
|
+
await bot.unmute_user(chat_id, user_id)
|
|
278
|
+
await bot.pin_message(chat_id, message)
|
|
279
|
+
await bot.unpin_message(chat_id, message)
|
|
280
|
+
await bot.join_chat(chat_id)
|
|
281
|
+
await bot.leave_chat(chat_id)
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Project Structure
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
spluspy/
|
|
288
|
+
├── __init__.py # Public API
|
|
289
|
+
├── __version__.py # Version info
|
|
290
|
+
├── client/ # Client and conversation API
|
|
291
|
+
├── types/ # Domain models (Message, User, Chat, Media, etc.)
|
|
292
|
+
├── events/ # Event types and builders
|
|
293
|
+
├── filters/ # Composable message filters
|
|
294
|
+
├── errors/ # Custom exception hierarchy
|
|
295
|
+
├── session/ # Session backends (SQLite, Memory, String)
|
|
296
|
+
├── network/ # TCP connections and connection pool
|
|
297
|
+
├── storage/ # Key-value storage backends
|
|
298
|
+
├── plugins/ # Plugin loader
|
|
299
|
+
├── middleware/ # Middleware system
|
|
300
|
+
├── fsm/ # Finite state machine
|
|
301
|
+
├── scheduler/ # Task scheduler
|
|
302
|
+
├── utils/ # Logger, cache, helpers
|
|
303
|
+
└── sync/ # Synchronous client wrapper
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Contributing
|
|
307
|
+
|
|
308
|
+
1. Fork the repository
|
|
309
|
+
2. Create a feature branch
|
|
310
|
+
3. Make your changes
|
|
311
|
+
4. Run tests: `pytest`
|
|
312
|
+
5. Submit a pull request
|
|
313
|
+
|
|
314
|
+
## License
|
|
315
|
+
|
|
316
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
317
|
+
|
|
318
|
+
## Disclaimer
|
|
319
|
+
|
|
320
|
+
SPlusPy is an unofficial third-party library. Use it responsibly and ensure your applications comply with Soroush Plus's Terms of Service.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
**Made with ❤️ for the Soroush Plus community**
|