BaleClient 1.0.0__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.
- baleclient-1.0.0/BaleClient.egg-info/PKG-INFO +153 -0
- baleclient-1.0.0/BaleClient.egg-info/SOURCES.txt +236 -0
- baleclient-1.0.0/BaleClient.egg-info/dependency_links.txt +1 -0
- baleclient-1.0.0/BaleClient.egg-info/requires.txt +7 -0
- baleclient-1.0.0/BaleClient.egg-info/top_level.txt +1 -0
- baleclient-1.0.0/LICENSE +21 -0
- baleclient-1.0.0/PKG-INFO +153 -0
- baleclient-1.0.0/README.md +137 -0
- baleclient-1.0.0/baleclient/__init__.py +17 -0
- baleclient-1.0.0/baleclient/client/auth_cli.py +392 -0
- baleclient-1.0.0/baleclient/client/client.py +3723 -0
- baleclient-1.0.0/baleclient/client/context_controller.py +39 -0
- baleclient-1.0.0/baleclient/client/session/__init__.py +4 -0
- baleclient-1.0.0/baleclient/client/session/aiohttp.py +254 -0
- baleclient-1.0.0/baleclient/client/session/base.py +221 -0
- baleclient-1.0.0/baleclient/dispatcher/__init__.py +11 -0
- baleclient-1.0.0/baleclient/dispatcher/dispatcher.py +36 -0
- baleclient-1.0.0/baleclient/dispatcher/event/__init__.py +0 -0
- baleclient-1.0.0/baleclient/dispatcher/event/handler.py +84 -0
- baleclient-1.0.0/baleclient/dispatcher/event/observer.py +40 -0
- baleclient-1.0.0/baleclient/dispatcher/router.py +92 -0
- baleclient-1.0.0/baleclient/enums/__init__.py +33 -0
- baleclient-1.0.0/baleclient/enums/auth_errors.py +34 -0
- baleclient-1.0.0/baleclient/enums/chat_type.py +25 -0
- baleclient-1.0.0/baleclient/enums/gift_openning.py +22 -0
- baleclient-1.0.0/baleclient/enums/giving_type.py +13 -0
- baleclient-1.0.0/baleclient/enums/group_type.py +16 -0
- baleclient-1.0.0/baleclient/enums/list_load_mode.py +19 -0
- baleclient-1.0.0/baleclient/enums/peer_source.py +22 -0
- baleclient-1.0.0/baleclient/enums/peer_type.py +16 -0
- baleclient-1.0.0/baleclient/enums/privacy_mode.py +16 -0
- baleclient-1.0.0/baleclient/enums/report_kind.py +28 -0
- baleclient-1.0.0/baleclient/enums/restriction.py +13 -0
- baleclient-1.0.0/baleclient/enums/send_code.py +46 -0
- baleclient-1.0.0/baleclient/enums/send_type.py +34 -0
- baleclient-1.0.0/baleclient/enums/services.py +38 -0
- baleclient-1.0.0/baleclient/enums/typing_type.py +46 -0
- baleclient-1.0.0/baleclient/exceptions.py +27 -0
- baleclient-1.0.0/baleclient/filters/__init__.py +19 -0
- baleclient-1.0.0/baleclient/filters/base.py +46 -0
- baleclient-1.0.0/baleclient/filters/chat.py +90 -0
- baleclient-1.0.0/baleclient/filters/content.py +74 -0
- baleclient-1.0.0/baleclient/filters/logic.py +160 -0
- baleclient-1.0.0/baleclient/filters/regex.py +43 -0
- baleclient-1.0.0/baleclient/logger.py +19 -0
- baleclient-1.0.0/baleclient/methods/__init__.py +161 -0
- baleclient-1.0.0/baleclient/methods/abacus/__init__.py +13 -0
- baleclient-1.0.0/baleclient/methods/abacus/get_message_reactions_list.py +76 -0
- baleclient-1.0.0/baleclient/methods/abacus/get_messages_reaction.py +62 -0
- baleclient-1.0.0/baleclient/methods/abacus/get_messages_views.py +44 -0
- baleclient-1.0.0/baleclient/methods/abacus/message_remove_reaction.py +62 -0
- baleclient-1.0.0/baleclient/methods/abacus/message_set_reaction.py +62 -0
- baleclient-1.0.0/baleclient/methods/auth/__init__.py +7 -0
- baleclient-1.0.0/baleclient/methods/auth/sign_out.py +19 -0
- baleclient-1.0.0/baleclient/methods/auth/sign_up.py +30 -0
- baleclient-1.0.0/baleclient/methods/auth/start_phone_auth.py +82 -0
- baleclient-1.0.0/baleclient/methods/auth/validate_code.py +45 -0
- baleclient-1.0.0/baleclient/methods/auth/validate_password.py +50 -0
- baleclient-1.0.0/baleclient/methods/base.py +63 -0
- baleclient-1.0.0/baleclient/methods/configs/__init__.py +7 -0
- baleclient-1.0.0/baleclient/methods/configs/edit_parameter.py +40 -0
- baleclient-1.0.0/baleclient/methods/configs/get_parameters.py +17 -0
- baleclient-1.0.0/baleclient/methods/files/__init__.py +4 -0
- baleclient-1.0.0/baleclient/methods/files/get_file_upload_url.py +75 -0
- baleclient-1.0.0/baleclient/methods/files/get_file_url.py +35 -0
- baleclient-1.0.0/baleclient/methods/giftpacket/__init__.py +4 -0
- baleclient-1.0.0/baleclient/methods/giftpacket/open_packet.py +56 -0
- baleclient-1.0.0/baleclient/methods/giftpacket/send_gift_packet_with_wallet.py +56 -0
- baleclient-1.0.0/baleclient/methods/groups/__init__.py +58 -0
- baleclient-1.0.0/baleclient/methods/groups/create_group.py +76 -0
- baleclient-1.0.0/baleclient/methods/groups/edit_channel_username.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/edit_group_about.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/edit_group_title.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/get_banned_users.py +36 -0
- baleclient-1.0.0/baleclient/methods/groups/get_full_group.py +35 -0
- baleclient-1.0.0/baleclient/methods/groups/get_group_invite_url.py +35 -0
- baleclient-1.0.0/baleclient/methods/groups/get_group_preview.py +32 -0
- baleclient-1.0.0/baleclient/methods/groups/get_member_permissions.py +44 -0
- baleclient-1.0.0/baleclient/methods/groups/get_pins.py +50 -0
- baleclient-1.0.0/baleclient/methods/groups/invite_users.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/join_group.py +32 -0
- baleclient-1.0.0/baleclient/methods/groups/join_public_group.py +33 -0
- baleclient-1.0.0/baleclient/methods/groups/kick_user.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/leave_group.py +40 -0
- baleclient-1.0.0/baleclient/methods/groups/load_members.py +62 -0
- baleclient-1.0.0/baleclient/methods/groups/make_user_admin.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/pin_message.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/remove_pin.py +35 -0
- baleclient-1.0.0/baleclient/methods/groups/remove_single_pin.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/remove_user_admin.py +44 -0
- baleclient-1.0.0/baleclient/methods/groups/revoke_invite_url.py +35 -0
- baleclient-1.0.0/baleclient/methods/groups/set_group_default_permissions.py +44 -0
- baleclient-1.0.0/baleclient/methods/groups/set_member_permissions.py +52 -0
- baleclient-1.0.0/baleclient/methods/groups/set_restriction.py +55 -0
- baleclient-1.0.0/baleclient/methods/groups/transfer_ownership.py +40 -0
- baleclient-1.0.0/baleclient/methods/groups/unban_user.py +44 -0
- baleclient-1.0.0/baleclient/methods/kifpool/__init__.py +3 -0
- baleclient-1.0.0/baleclient/methods/kifpool/get_my_kifpools.py +15 -0
- baleclient-1.0.0/baleclient/methods/magazine/__init__.py +5 -0
- baleclient-1.0.0/baleclient/methods/magazine/get_message_upvoters.py +39 -0
- baleclient-1.0.0/baleclient/methods/magazine/revoke_upvoted_post.py +37 -0
- baleclient-1.0.0/baleclient/methods/magazine/upvote_post.py +37 -0
- baleclient-1.0.0/baleclient/methods/messaging/__init__.py +27 -0
- baleclient-1.0.0/baleclient/methods/messaging/clear_chat.py +33 -0
- baleclient-1.0.0/baleclient/methods/messaging/delete_chat.py +33 -0
- baleclient-1.0.0/baleclient/methods/messaging/delete_message.py +70 -0
- baleclient-1.0.0/baleclient/methods/messaging/forward_message.py +55 -0
- baleclient-1.0.0/baleclient/methods/messaging/load_dialogs.py +54 -0
- baleclient-1.0.0/baleclient/methods/messaging/load_history.py +62 -0
- baleclient-1.0.0/baleclient/methods/messaging/load_pinned.py +35 -0
- baleclient-1.0.0/baleclient/methods/messaging/message_read.py +41 -0
- baleclient-1.0.0/baleclient/methods/messaging/pin_message.py +52 -0
- baleclient-1.0.0/baleclient/methods/messaging/send_message.py +69 -0
- baleclient-1.0.0/baleclient/methods/messaging/unpin_messages.py +55 -0
- baleclient-1.0.0/baleclient/methods/messaging/update_message.py +55 -0
- baleclient-1.0.0/baleclient/methods/presence/__init__.py +5 -0
- baleclient-1.0.0/baleclient/methods/presence/set_online.py +41 -0
- baleclient-1.0.0/baleclient/methods/presence/stop_typing.py +44 -0
- baleclient-1.0.0/baleclient/methods/presence/typing.py +44 -0
- baleclient-1.0.0/baleclient/methods/report/__init__.py +3 -0
- baleclient-1.0.0/baleclient/methods/report/send_report.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/__init__.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/add_contact.py +39 -0
- baleclient-1.0.0/baleclient/methods/user/block_user.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/check_nickname.py +34 -0
- baleclient-1.0.0/baleclient/methods/user/edit_about.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/edit_name.py +34 -0
- baleclient-1.0.0/baleclient/methods/user/edit_nickname.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/edit_user_local_name.py +51 -0
- baleclient-1.0.0/baleclient/methods/user/get_contacts.py +17 -0
- baleclient-1.0.0/baleclient/methods/user/import_contacts.py +36 -0
- baleclient-1.0.0/baleclient/methods/user/load_blocked_users.py +17 -0
- baleclient-1.0.0/baleclient/methods/user/load_full_users.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/load_users.py +35 -0
- baleclient-1.0.0/baleclient/methods/user/remove_contact.py +39 -0
- baleclient-1.0.0/baleclient/methods/user/reset_contacts.py +17 -0
- baleclient-1.0.0/baleclient/methods/user/search_contact.py +34 -0
- baleclient-1.0.0/baleclient/methods/user/unblock_user.py +35 -0
- baleclient-1.0.0/baleclient/types/__init__.py +139 -0
- baleclient-1.0.0/baleclient/types/auth.py +29 -0
- baleclient-1.0.0/baleclient/types/ban_data.py +44 -0
- baleclient-1.0.0/baleclient/types/base.py +33 -0
- baleclient-1.0.0/baleclient/types/block_updates.py +41 -0
- baleclient-1.0.0/baleclient/types/chat.py +30 -0
- baleclient-1.0.0/baleclient/types/chat_data.py +27 -0
- baleclient-1.0.0/baleclient/types/client.py +57 -0
- baleclient-1.0.0/baleclient/types/condition.py +34 -0
- baleclient-1.0.0/baleclient/types/contact_request.py +32 -0
- baleclient-1.0.0/baleclient/types/ext.py +77 -0
- baleclient-1.0.0/baleclient/types/file_details.py +50 -0
- baleclient-1.0.0/baleclient/types/file_ext.py +168 -0
- baleclient-1.0.0/baleclient/types/file_info.py +49 -0
- baleclient-1.0.0/baleclient/types/file_input.py +132 -0
- baleclient-1.0.0/baleclient/types/file_upload_info.py +45 -0
- baleclient-1.0.0/baleclient/types/file_url.py +64 -0
- baleclient-1.0.0/baleclient/types/full_group.py +154 -0
- baleclient-1.0.0/baleclient/types/full_user.py +174 -0
- baleclient-1.0.0/baleclient/types/gift_packet.py +73 -0
- baleclient-1.0.0/baleclient/types/group.py +133 -0
- baleclient-1.0.0/baleclient/types/info_changed.py +97 -0
- baleclient-1.0.0/baleclient/types/info_message.py +62 -0
- baleclient-1.0.0/baleclient/types/info_peer.py +42 -0
- baleclient-1.0.0/baleclient/types/inline_keyboard.py +167 -0
- baleclient-1.0.0/baleclient/types/int_bool.py +60 -0
- baleclient-1.0.0/baleclient/types/member.py +93 -0
- baleclient-1.0.0/baleclient/types/message.py +762 -0
- baleclient-1.0.0/baleclient/types/message_content.py +211 -0
- baleclient-1.0.0/baleclient/types/message_data.py +140 -0
- baleclient-1.0.0/baleclient/types/message_reaction.py +70 -0
- baleclient-1.0.0/baleclient/types/message_report.py +33 -0
- baleclient-1.0.0/baleclient/types/message_updates.py +102 -0
- baleclient-1.0.0/baleclient/types/message_views.py +50 -0
- baleclient-1.0.0/baleclient/types/other_message.py +37 -0
- baleclient-1.0.0/baleclient/types/peer.py +41 -0
- baleclient-1.0.0/baleclient/types/peer_data.py +106 -0
- baleclient-1.0.0/baleclient/types/peer_report.py +31 -0
- baleclient-1.0.0/baleclient/types/permissions.py +162 -0
- baleclient-1.0.0/baleclient/types/quoted_message.py +88 -0
- baleclient-1.0.0/baleclient/types/reaction.py +84 -0
- baleclient-1.0.0/baleclient/types/reaction_data.py +40 -0
- baleclient-1.0.0/baleclient/types/report.py +48 -0
- baleclient-1.0.0/baleclient/types/request.py +115 -0
- baleclient-1.0.0/baleclient/types/response.py +126 -0
- baleclient-1.0.0/baleclient/types/responses/__init__.py +64 -0
- baleclient-1.0.0/baleclient/types/responses/auth.py +77 -0
- baleclient-1.0.0/baleclient/types/responses/banned_users.py +46 -0
- baleclient-1.0.0/baleclient/types/responses/blocked_users.py +44 -0
- baleclient-1.0.0/baleclient/types/responses/contacts.py +44 -0
- baleclient-1.0.0/baleclient/types/responses/create_group.py +64 -0
- baleclient-1.0.0/baleclient/types/responses/default.py +36 -0
- baleclient-1.0.0/baleclient/types/responses/dialogs.py +46 -0
- baleclient-1.0.0/baleclient/types/responses/file_url.py +51 -0
- baleclient-1.0.0/baleclient/types/responses/full_group.py +31 -0
- baleclient-1.0.0/baleclient/types/responses/get_pins.py +92 -0
- baleclient-1.0.0/baleclient/types/responses/history.py +64 -0
- baleclient-1.0.0/baleclient/types/responses/invite.py +49 -0
- baleclient-1.0.0/baleclient/types/responses/invite_url.py +30 -0
- baleclient-1.0.0/baleclient/types/responses/join_group.py +73 -0
- baleclient-1.0.0/baleclient/types/responses/load_members.py +50 -0
- baleclient-1.0.0/baleclient/types/responses/load_users.py +89 -0
- baleclient-1.0.0/baleclient/types/responses/member_permissions.py +32 -0
- baleclient-1.0.0/baleclient/types/responses/message.py +97 -0
- baleclient-1.0.0/baleclient/types/responses/messages_reactions.py +50 -0
- baleclient-1.0.0/baleclient/types/responses/nickname_available.py +30 -0
- baleclient-1.0.0/baleclient/types/responses/open_packet.py +67 -0
- baleclient-1.0.0/baleclient/types/responses/parameters.py +30 -0
- baleclient-1.0.0/baleclient/types/responses/reaction_list.py +49 -0
- baleclient-1.0.0/baleclient/types/responses/reaction_sent.py +49 -0
- baleclient-1.0.0/baleclient/types/responses/search_contact.py +38 -0
- baleclient-1.0.0/baleclient/types/responses/upvote_response.py +26 -0
- baleclient-1.0.0/baleclient/types/responses/upvoters_response.py +52 -0
- baleclient-1.0.0/baleclient/types/responses/validate_code.py +35 -0
- baleclient-1.0.0/baleclient/types/responses/views_response.py +48 -0
- baleclient-1.0.0/baleclient/types/responses/wallet.py +54 -0
- baleclient-1.0.0/baleclient/types/selected_messages.py +55 -0
- baleclient-1.0.0/baleclient/types/send_type.py +27 -0
- baleclient-1.0.0/baleclient/types/service_ext.py +18 -0
- baleclient-1.0.0/baleclient/types/service_message.py +9 -0
- baleclient-1.0.0/baleclient/types/short_peer.py +28 -0
- baleclient-1.0.0/baleclient/types/thumbnail.py +43 -0
- baleclient-1.0.0/baleclient/types/update.py +153 -0
- baleclient-1.0.0/baleclient/types/updated_message.py +101 -0
- baleclient-1.0.0/baleclient/types/upvote.py +42 -0
- baleclient-1.0.0/baleclient/types/user.py +148 -0
- baleclient-1.0.0/baleclient/types/values.py +89 -0
- baleclient-1.0.0/baleclient/types/wallet.py +77 -0
- baleclient-1.0.0/baleclient/types/winner.py +41 -0
- baleclient-1.0.0/baleclient/utils/__init__.py +18 -0
- baleclient-1.0.0/baleclient/utils/file_helper.py +53 -0
- baleclient-1.0.0/baleclient/utils/grpc_post.py +77 -0
- baleclient-1.0.0/baleclient/utils/int64.py +17 -0
- baleclient-1.0.0/baleclient/utils/jwt_checker.py +20 -0
- baleclient-1.0.0/baleclient/utils/links.py +10 -0
- baleclient-1.0.0/baleclient/utils/magic_filter.py +22 -0
- baleclient-1.0.0/baleclient/utils/protobuf.py +238 -0
- baleclient-1.0.0/baleclient/utils/random.py +9 -0
- baleclient-1.0.0/pyproject.toml +32 -0
- baleclient-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BaleClient
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Author-email: "foad.kheirabady" <foad.kheirabady@gmail.com>
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: aiohttp<4.0,>=3.9
|
|
9
|
+
Requires-Dist: aiofiles<24.0,>=23.1
|
|
10
|
+
Requires-Dist: colorama<1.0,>=0.4.6
|
|
11
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
12
|
+
Requires-Dist: typing_extensions<5.0,>=4.0
|
|
13
|
+
Requires-Dist: blackboxprotobuf<2.0,>=1.0.1
|
|
14
|
+
Requires-Dist: magic-filter<2.0,>=1.0
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# BaleClient
|
|
18
|
+
|
|
19
|
+
⚡ **BaleClient** is a maintained fork / rework of **Aiobale**, an asynchronous Python client for **Bale Messenger**.
|
|
20
|
+
|
|
21
|
+
The original library is great but contains several bugs and incomplete implementations.
|
|
22
|
+
This project fixes those issues and adds improvements for reliability, stability, and usability.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install from PyPI:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install baleclient
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Upgrade to the latest version:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install -U baleclient
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Install from source:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/Foad-KhAb/baleclient.git
|
|
44
|
+
cd baleclient
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Requirements
|
|
51
|
+
|
|
52
|
+
* Python **3.11+**
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick Example
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from baleclient import Client
|
|
60
|
+
|
|
61
|
+
async def main():
|
|
62
|
+
async with Client("session") as client:
|
|
63
|
+
me = await client.get_me()
|
|
64
|
+
print(me)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
* Fully **asynchronous** API
|
|
72
|
+
* Lightweight and fast
|
|
73
|
+
* Improved parsing reliability
|
|
74
|
+
* Better error handling
|
|
75
|
+
* Maintained fork of Aiobale
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Based On
|
|
80
|
+
|
|
81
|
+
This project is based on:
|
|
82
|
+
|
|
83
|
+
**Aiobale**
|
|
84
|
+
https://github.com/Enalite/aiobale
|
|
85
|
+
|
|
86
|
+
Credit to the original author for the initial implementation.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Why BaleClient?
|
|
91
|
+
|
|
92
|
+
While using Aiobale in real projects, I encountered several issues such as:
|
|
93
|
+
|
|
94
|
+
* parsing bugs
|
|
95
|
+
* inconsistent API responses
|
|
96
|
+
* missing validations
|
|
97
|
+
* edge cases not handled
|
|
98
|
+
|
|
99
|
+
**BaleClient** fixes these problems and introduces improvements to make the library more stable for production usage.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Fixes
|
|
104
|
+
|
|
105
|
+
List of fixes applied to the original library:
|
|
106
|
+
|
|
107
|
+
* [x] Fix dialog response parsing
|
|
108
|
+
* [x] Fix message caption parsing
|
|
109
|
+
* [x] Fix incorrect type validations
|
|
110
|
+
|
|
111
|
+
*(this list will grow as more issues are discovered)*
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Added Improvements
|
|
116
|
+
|
|
117
|
+
Additional features and improvements:
|
|
118
|
+
|
|
119
|
+
* [x] Better error handling when reading corrupted or modified session files
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Changelog
|
|
124
|
+
|
|
125
|
+
### v0.1.0
|
|
126
|
+
|
|
127
|
+
* Initial release
|
|
128
|
+
* Fork of Aiobale with several fixes
|
|
129
|
+
* Improved session error handling
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Documentation
|
|
134
|
+
|
|
135
|
+
Documentation will be expanded in future releases.
|
|
136
|
+
|
|
137
|
+
For now, refer to:
|
|
138
|
+
|
|
139
|
+
* The source code
|
|
140
|
+
* Example usage in the repository
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Notes
|
|
145
|
+
|
|
146
|
+
* BaleClient is **not an official Bale API library**
|
|
147
|
+
* The Bale API is internal and may change without notice
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
This project follows the same license as the original project unless otherwise specified.
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
BaleClient.egg-info/PKG-INFO
|
|
5
|
+
BaleClient.egg-info/SOURCES.txt
|
|
6
|
+
BaleClient.egg-info/dependency_links.txt
|
|
7
|
+
BaleClient.egg-info/requires.txt
|
|
8
|
+
BaleClient.egg-info/top_level.txt
|
|
9
|
+
baleclient/__init__.py
|
|
10
|
+
baleclient/exceptions.py
|
|
11
|
+
baleclient/logger.py
|
|
12
|
+
baleclient/client/auth_cli.py
|
|
13
|
+
baleclient/client/client.py
|
|
14
|
+
baleclient/client/context_controller.py
|
|
15
|
+
baleclient/client/session/__init__.py
|
|
16
|
+
baleclient/client/session/aiohttp.py
|
|
17
|
+
baleclient/client/session/base.py
|
|
18
|
+
baleclient/dispatcher/__init__.py
|
|
19
|
+
baleclient/dispatcher/dispatcher.py
|
|
20
|
+
baleclient/dispatcher/router.py
|
|
21
|
+
baleclient/dispatcher/event/__init__.py
|
|
22
|
+
baleclient/dispatcher/event/handler.py
|
|
23
|
+
baleclient/dispatcher/event/observer.py
|
|
24
|
+
baleclient/enums/__init__.py
|
|
25
|
+
baleclient/enums/auth_errors.py
|
|
26
|
+
baleclient/enums/chat_type.py
|
|
27
|
+
baleclient/enums/gift_openning.py
|
|
28
|
+
baleclient/enums/giving_type.py
|
|
29
|
+
baleclient/enums/group_type.py
|
|
30
|
+
baleclient/enums/list_load_mode.py
|
|
31
|
+
baleclient/enums/peer_source.py
|
|
32
|
+
baleclient/enums/peer_type.py
|
|
33
|
+
baleclient/enums/privacy_mode.py
|
|
34
|
+
baleclient/enums/report_kind.py
|
|
35
|
+
baleclient/enums/restriction.py
|
|
36
|
+
baleclient/enums/send_code.py
|
|
37
|
+
baleclient/enums/send_type.py
|
|
38
|
+
baleclient/enums/services.py
|
|
39
|
+
baleclient/enums/typing_type.py
|
|
40
|
+
baleclient/filters/__init__.py
|
|
41
|
+
baleclient/filters/base.py
|
|
42
|
+
baleclient/filters/chat.py
|
|
43
|
+
baleclient/filters/content.py
|
|
44
|
+
baleclient/filters/logic.py
|
|
45
|
+
baleclient/filters/regex.py
|
|
46
|
+
baleclient/methods/__init__.py
|
|
47
|
+
baleclient/methods/base.py
|
|
48
|
+
baleclient/methods/abacus/__init__.py
|
|
49
|
+
baleclient/methods/abacus/get_message_reactions_list.py
|
|
50
|
+
baleclient/methods/abacus/get_messages_reaction.py
|
|
51
|
+
baleclient/methods/abacus/get_messages_views.py
|
|
52
|
+
baleclient/methods/abacus/message_remove_reaction.py
|
|
53
|
+
baleclient/methods/abacus/message_set_reaction.py
|
|
54
|
+
baleclient/methods/auth/__init__.py
|
|
55
|
+
baleclient/methods/auth/sign_out.py
|
|
56
|
+
baleclient/methods/auth/sign_up.py
|
|
57
|
+
baleclient/methods/auth/start_phone_auth.py
|
|
58
|
+
baleclient/methods/auth/validate_code.py
|
|
59
|
+
baleclient/methods/auth/validate_password.py
|
|
60
|
+
baleclient/methods/configs/__init__.py
|
|
61
|
+
baleclient/methods/configs/edit_parameter.py
|
|
62
|
+
baleclient/methods/configs/get_parameters.py
|
|
63
|
+
baleclient/methods/files/__init__.py
|
|
64
|
+
baleclient/methods/files/get_file_upload_url.py
|
|
65
|
+
baleclient/methods/files/get_file_url.py
|
|
66
|
+
baleclient/methods/giftpacket/__init__.py
|
|
67
|
+
baleclient/methods/giftpacket/open_packet.py
|
|
68
|
+
baleclient/methods/giftpacket/send_gift_packet_with_wallet.py
|
|
69
|
+
baleclient/methods/groups/__init__.py
|
|
70
|
+
baleclient/methods/groups/create_group.py
|
|
71
|
+
baleclient/methods/groups/edit_channel_username.py
|
|
72
|
+
baleclient/methods/groups/edit_group_about.py
|
|
73
|
+
baleclient/methods/groups/edit_group_title.py
|
|
74
|
+
baleclient/methods/groups/get_banned_users.py
|
|
75
|
+
baleclient/methods/groups/get_full_group.py
|
|
76
|
+
baleclient/methods/groups/get_group_invite_url.py
|
|
77
|
+
baleclient/methods/groups/get_group_preview.py
|
|
78
|
+
baleclient/methods/groups/get_member_permissions.py
|
|
79
|
+
baleclient/methods/groups/get_pins.py
|
|
80
|
+
baleclient/methods/groups/invite_users.py
|
|
81
|
+
baleclient/methods/groups/join_group.py
|
|
82
|
+
baleclient/methods/groups/join_public_group.py
|
|
83
|
+
baleclient/methods/groups/kick_user.py
|
|
84
|
+
baleclient/methods/groups/leave_group.py
|
|
85
|
+
baleclient/methods/groups/load_members.py
|
|
86
|
+
baleclient/methods/groups/make_user_admin.py
|
|
87
|
+
baleclient/methods/groups/pin_message.py
|
|
88
|
+
baleclient/methods/groups/remove_pin.py
|
|
89
|
+
baleclient/methods/groups/remove_single_pin.py
|
|
90
|
+
baleclient/methods/groups/remove_user_admin.py
|
|
91
|
+
baleclient/methods/groups/revoke_invite_url.py
|
|
92
|
+
baleclient/methods/groups/set_group_default_permissions.py
|
|
93
|
+
baleclient/methods/groups/set_member_permissions.py
|
|
94
|
+
baleclient/methods/groups/set_restriction.py
|
|
95
|
+
baleclient/methods/groups/transfer_ownership.py
|
|
96
|
+
baleclient/methods/groups/unban_user.py
|
|
97
|
+
baleclient/methods/kifpool/__init__.py
|
|
98
|
+
baleclient/methods/kifpool/get_my_kifpools.py
|
|
99
|
+
baleclient/methods/magazine/__init__.py
|
|
100
|
+
baleclient/methods/magazine/get_message_upvoters.py
|
|
101
|
+
baleclient/methods/magazine/revoke_upvoted_post.py
|
|
102
|
+
baleclient/methods/magazine/upvote_post.py
|
|
103
|
+
baleclient/methods/messaging/__init__.py
|
|
104
|
+
baleclient/methods/messaging/clear_chat.py
|
|
105
|
+
baleclient/methods/messaging/delete_chat.py
|
|
106
|
+
baleclient/methods/messaging/delete_message.py
|
|
107
|
+
baleclient/methods/messaging/forward_message.py
|
|
108
|
+
baleclient/methods/messaging/load_dialogs.py
|
|
109
|
+
baleclient/methods/messaging/load_history.py
|
|
110
|
+
baleclient/methods/messaging/load_pinned.py
|
|
111
|
+
baleclient/methods/messaging/message_read.py
|
|
112
|
+
baleclient/methods/messaging/pin_message.py
|
|
113
|
+
baleclient/methods/messaging/send_message.py
|
|
114
|
+
baleclient/methods/messaging/unpin_messages.py
|
|
115
|
+
baleclient/methods/messaging/update_message.py
|
|
116
|
+
baleclient/methods/presence/__init__.py
|
|
117
|
+
baleclient/methods/presence/set_online.py
|
|
118
|
+
baleclient/methods/presence/stop_typing.py
|
|
119
|
+
baleclient/methods/presence/typing.py
|
|
120
|
+
baleclient/methods/report/__init__.py
|
|
121
|
+
baleclient/methods/report/send_report.py
|
|
122
|
+
baleclient/methods/user/__init__.py
|
|
123
|
+
baleclient/methods/user/add_contact.py
|
|
124
|
+
baleclient/methods/user/block_user.py
|
|
125
|
+
baleclient/methods/user/check_nickname.py
|
|
126
|
+
baleclient/methods/user/edit_about.py
|
|
127
|
+
baleclient/methods/user/edit_name.py
|
|
128
|
+
baleclient/methods/user/edit_nickname.py
|
|
129
|
+
baleclient/methods/user/edit_user_local_name.py
|
|
130
|
+
baleclient/methods/user/get_contacts.py
|
|
131
|
+
baleclient/methods/user/import_contacts.py
|
|
132
|
+
baleclient/methods/user/load_blocked_users.py
|
|
133
|
+
baleclient/methods/user/load_full_users.py
|
|
134
|
+
baleclient/methods/user/load_users.py
|
|
135
|
+
baleclient/methods/user/remove_contact.py
|
|
136
|
+
baleclient/methods/user/reset_contacts.py
|
|
137
|
+
baleclient/methods/user/search_contact.py
|
|
138
|
+
baleclient/methods/user/unblock_user.py
|
|
139
|
+
baleclient/types/__init__.py
|
|
140
|
+
baleclient/types/auth.py
|
|
141
|
+
baleclient/types/ban_data.py
|
|
142
|
+
baleclient/types/base.py
|
|
143
|
+
baleclient/types/block_updates.py
|
|
144
|
+
baleclient/types/chat.py
|
|
145
|
+
baleclient/types/chat_data.py
|
|
146
|
+
baleclient/types/client.py
|
|
147
|
+
baleclient/types/condition.py
|
|
148
|
+
baleclient/types/contact_request.py
|
|
149
|
+
baleclient/types/ext.py
|
|
150
|
+
baleclient/types/file_details.py
|
|
151
|
+
baleclient/types/file_ext.py
|
|
152
|
+
baleclient/types/file_info.py
|
|
153
|
+
baleclient/types/file_input.py
|
|
154
|
+
baleclient/types/file_upload_info.py
|
|
155
|
+
baleclient/types/file_url.py
|
|
156
|
+
baleclient/types/full_group.py
|
|
157
|
+
baleclient/types/full_user.py
|
|
158
|
+
baleclient/types/gift_packet.py
|
|
159
|
+
baleclient/types/group.py
|
|
160
|
+
baleclient/types/info_changed.py
|
|
161
|
+
baleclient/types/info_message.py
|
|
162
|
+
baleclient/types/info_peer.py
|
|
163
|
+
baleclient/types/inline_keyboard.py
|
|
164
|
+
baleclient/types/int_bool.py
|
|
165
|
+
baleclient/types/member.py
|
|
166
|
+
baleclient/types/message.py
|
|
167
|
+
baleclient/types/message_content.py
|
|
168
|
+
baleclient/types/message_data.py
|
|
169
|
+
baleclient/types/message_reaction.py
|
|
170
|
+
baleclient/types/message_report.py
|
|
171
|
+
baleclient/types/message_updates.py
|
|
172
|
+
baleclient/types/message_views.py
|
|
173
|
+
baleclient/types/other_message.py
|
|
174
|
+
baleclient/types/peer.py
|
|
175
|
+
baleclient/types/peer_data.py
|
|
176
|
+
baleclient/types/peer_report.py
|
|
177
|
+
baleclient/types/permissions.py
|
|
178
|
+
baleclient/types/quoted_message.py
|
|
179
|
+
baleclient/types/reaction.py
|
|
180
|
+
baleclient/types/reaction_data.py
|
|
181
|
+
baleclient/types/report.py
|
|
182
|
+
baleclient/types/request.py
|
|
183
|
+
baleclient/types/response.py
|
|
184
|
+
baleclient/types/selected_messages.py
|
|
185
|
+
baleclient/types/send_type.py
|
|
186
|
+
baleclient/types/service_ext.py
|
|
187
|
+
baleclient/types/service_message.py
|
|
188
|
+
baleclient/types/short_peer.py
|
|
189
|
+
baleclient/types/thumbnail.py
|
|
190
|
+
baleclient/types/update.py
|
|
191
|
+
baleclient/types/updated_message.py
|
|
192
|
+
baleclient/types/upvote.py
|
|
193
|
+
baleclient/types/user.py
|
|
194
|
+
baleclient/types/values.py
|
|
195
|
+
baleclient/types/wallet.py
|
|
196
|
+
baleclient/types/winner.py
|
|
197
|
+
baleclient/types/responses/__init__.py
|
|
198
|
+
baleclient/types/responses/auth.py
|
|
199
|
+
baleclient/types/responses/banned_users.py
|
|
200
|
+
baleclient/types/responses/blocked_users.py
|
|
201
|
+
baleclient/types/responses/contacts.py
|
|
202
|
+
baleclient/types/responses/create_group.py
|
|
203
|
+
baleclient/types/responses/default.py
|
|
204
|
+
baleclient/types/responses/dialogs.py
|
|
205
|
+
baleclient/types/responses/file_url.py
|
|
206
|
+
baleclient/types/responses/full_group.py
|
|
207
|
+
baleclient/types/responses/get_pins.py
|
|
208
|
+
baleclient/types/responses/history.py
|
|
209
|
+
baleclient/types/responses/invite.py
|
|
210
|
+
baleclient/types/responses/invite_url.py
|
|
211
|
+
baleclient/types/responses/join_group.py
|
|
212
|
+
baleclient/types/responses/load_members.py
|
|
213
|
+
baleclient/types/responses/load_users.py
|
|
214
|
+
baleclient/types/responses/member_permissions.py
|
|
215
|
+
baleclient/types/responses/message.py
|
|
216
|
+
baleclient/types/responses/messages_reactions.py
|
|
217
|
+
baleclient/types/responses/nickname_available.py
|
|
218
|
+
baleclient/types/responses/open_packet.py
|
|
219
|
+
baleclient/types/responses/parameters.py
|
|
220
|
+
baleclient/types/responses/reaction_list.py
|
|
221
|
+
baleclient/types/responses/reaction_sent.py
|
|
222
|
+
baleclient/types/responses/search_contact.py
|
|
223
|
+
baleclient/types/responses/upvote_response.py
|
|
224
|
+
baleclient/types/responses/upvoters_response.py
|
|
225
|
+
baleclient/types/responses/validate_code.py
|
|
226
|
+
baleclient/types/responses/views_response.py
|
|
227
|
+
baleclient/types/responses/wallet.py
|
|
228
|
+
baleclient/utils/__init__.py
|
|
229
|
+
baleclient/utils/file_helper.py
|
|
230
|
+
baleclient/utils/grpc_post.py
|
|
231
|
+
baleclient/utils/int64.py
|
|
232
|
+
baleclient/utils/jwt_checker.py
|
|
233
|
+
baleclient/utils/links.py
|
|
234
|
+
baleclient/utils/magic_filter.py
|
|
235
|
+
baleclient/utils/protobuf.py
|
|
236
|
+
baleclient/utils/random.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
baleclient
|
baleclient-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Alireza Jahani | Enalite LD
|
|
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.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BaleClient
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Author-email: "foad.kheirabady" <foad.kheirabady@gmail.com>
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: aiohttp<4.0,>=3.9
|
|
9
|
+
Requires-Dist: aiofiles<24.0,>=23.1
|
|
10
|
+
Requires-Dist: colorama<1.0,>=0.4.6
|
|
11
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
12
|
+
Requires-Dist: typing_extensions<5.0,>=4.0
|
|
13
|
+
Requires-Dist: blackboxprotobuf<2.0,>=1.0.1
|
|
14
|
+
Requires-Dist: magic-filter<2.0,>=1.0
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# BaleClient
|
|
18
|
+
|
|
19
|
+
⚡ **BaleClient** is a maintained fork / rework of **Aiobale**, an asynchronous Python client for **Bale Messenger**.
|
|
20
|
+
|
|
21
|
+
The original library is great but contains several bugs and incomplete implementations.
|
|
22
|
+
This project fixes those issues and adds improvements for reliability, stability, and usability.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install from PyPI:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install baleclient
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Upgrade to the latest version:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install -U baleclient
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Install from source:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/Foad-KhAb/baleclient.git
|
|
44
|
+
cd baleclient
|
|
45
|
+
pip install -e .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Requirements
|
|
51
|
+
|
|
52
|
+
* Python **3.11+**
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Quick Example
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from baleclient import Client
|
|
60
|
+
|
|
61
|
+
async def main():
|
|
62
|
+
async with Client("session") as client:
|
|
63
|
+
me = await client.get_me()
|
|
64
|
+
print(me)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
* Fully **asynchronous** API
|
|
72
|
+
* Lightweight and fast
|
|
73
|
+
* Improved parsing reliability
|
|
74
|
+
* Better error handling
|
|
75
|
+
* Maintained fork of Aiobale
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Based On
|
|
80
|
+
|
|
81
|
+
This project is based on:
|
|
82
|
+
|
|
83
|
+
**Aiobale**
|
|
84
|
+
https://github.com/Enalite/aiobale
|
|
85
|
+
|
|
86
|
+
Credit to the original author for the initial implementation.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Why BaleClient?
|
|
91
|
+
|
|
92
|
+
While using Aiobale in real projects, I encountered several issues such as:
|
|
93
|
+
|
|
94
|
+
* parsing bugs
|
|
95
|
+
* inconsistent API responses
|
|
96
|
+
* missing validations
|
|
97
|
+
* edge cases not handled
|
|
98
|
+
|
|
99
|
+
**BaleClient** fixes these problems and introduces improvements to make the library more stable for production usage.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Fixes
|
|
104
|
+
|
|
105
|
+
List of fixes applied to the original library:
|
|
106
|
+
|
|
107
|
+
* [x] Fix dialog response parsing
|
|
108
|
+
* [x] Fix message caption parsing
|
|
109
|
+
* [x] Fix incorrect type validations
|
|
110
|
+
|
|
111
|
+
*(this list will grow as more issues are discovered)*
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Added Improvements
|
|
116
|
+
|
|
117
|
+
Additional features and improvements:
|
|
118
|
+
|
|
119
|
+
* [x] Better error handling when reading corrupted or modified session files
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Changelog
|
|
124
|
+
|
|
125
|
+
### v0.1.0
|
|
126
|
+
|
|
127
|
+
* Initial release
|
|
128
|
+
* Fork of Aiobale with several fixes
|
|
129
|
+
* Improved session error handling
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Documentation
|
|
134
|
+
|
|
135
|
+
Documentation will be expanded in future releases.
|
|
136
|
+
|
|
137
|
+
For now, refer to:
|
|
138
|
+
|
|
139
|
+
* The source code
|
|
140
|
+
* Example usage in the repository
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Notes
|
|
145
|
+
|
|
146
|
+
* BaleClient is **not an official Bale API library**
|
|
147
|
+
* The Bale API is internal and may change without notice
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
This project follows the same license as the original project unless otherwise specified.
|