pyrobale 0.2.9.4__py3-none-any.whl → 0.3.5__py3-none-any.whl
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.
- pyrobale/__init__.py +3 -0
- pyrobale/client/__init__.py +574 -0
- pyrobale/exceptions/__init__.py +0 -0
- pyrobale/exceptions/common.py +10 -0
- pyrobale/objects/__init__.py +86 -0
- pyrobale/objects/animation.py +33 -0
- pyrobale/objects/audio.py +24 -0
- pyrobale/objects/callbackquery.py +42 -0
- pyrobale/objects/chat.py +463 -0
- pyrobale/objects/chatmember.py +162 -0
- pyrobale/objects/chatphoto.py +18 -0
- pyrobale/objects/contact.py +16 -0
- pyrobale/objects/copytextbutton.py +5 -0
- pyrobale/objects/document.py +26 -0
- pyrobale/objects/enums.py +28 -0
- pyrobale/objects/file.py +15 -0
- pyrobale/objects/inlinekeyboardbutton.py +24 -0
- pyrobale/objects/inlinekeyboardmarkup.py +84 -0
- pyrobale/objects/inputfile.py +17 -0
- pyrobale/objects/inputmedias.py +166 -0
- pyrobale/objects/invoice.py +14 -0
- pyrobale/objects/keyboardbutton.py +19 -0
- pyrobale/objects/labeledprice.py +8 -0
- pyrobale/objects/location.py +4 -0
- pyrobale/objects/message.py +368 -0
- pyrobale/objects/messageid.py +3 -0
- pyrobale/objects/photosize.py +9 -0
- pyrobale/objects/precheckoutquery.py +21 -0
- pyrobale/objects/replykeyboardmarkup.py +54 -0
- pyrobale/objects/sticker.py +16 -0
- pyrobale/objects/stickerset.py +12 -0
- pyrobale/objects/successfulpayment.py +15 -0
- pyrobale/objects/update.py +23 -0
- pyrobale/objects/user.py +20 -0
- pyrobale/objects/utils.py +28 -0
- pyrobale/objects/video.py +20 -0
- pyrobale/objects/voice.py +4 -0
- pyrobale/objects/webappdata.py +3 -0
- pyrobale/objects/webappinfo.py +3 -0
- pyrobale-0.3.5.dist-info/METADATA +176 -0
- pyrobale-0.3.5.dist-info/RECORD +43 -0
- pyrobale-0.3.5.dist-info/licenses/LICENSE +21 -0
- pyrobale-0.2.9.4.dist-info/METADATA +0 -833
- pyrobale-0.2.9.4.dist-info/RECORD +0 -5
- pyrobale-0.2.9.4.dist-info/licenses/LICENSE +0 -678
- pyrobale.py +0 -2545
- {pyrobale-0.2.9.4.dist-info → pyrobale-0.3.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,176 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: pyrobale
|
3
|
+
Version: 0.3.5
|
4
|
+
Summary: A python wrapper for bale api
|
5
|
+
Project-URL: github, https://github.com/pyrobale/pyrobale
|
6
|
+
Project-URL: website, https://pyrobale.github.io
|
7
|
+
Author-email: Ali Safamanesh <darg.q.a.a@gmail.com>
|
8
|
+
License: MIT License
|
9
|
+
|
10
|
+
Copyright (c) 2025 Ali Safamanesh
|
11
|
+
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
14
|
+
in the Software without restriction, including without limitation the rights
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
17
|
+
furnished to do so, subject to the following conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
20
|
+
copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
28
|
+
SOFTWARE.
|
29
|
+
License-File: LICENSE
|
30
|
+
Classifier: License :: OSI Approved :: MIT License
|
31
|
+
Classifier: Operating System :: OS Independent
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
33
|
+
Requires-Python: >=3.9
|
34
|
+
Description-Content-Type: text/markdown
|
35
|
+
|
36
|
+

|
37
|
+
|
38
|
+
# Bale Bot API Python Library
|
39
|
+
|
40
|
+
A Python wrapper for the Bale Bot API that makes it easy to build Bale bots.
|
41
|
+
|
42
|
+
## Features
|
43
|
+
|
44
|
+
- Full Bale Bot API support
|
45
|
+
- Object-oriented design
|
46
|
+
- Easy-to-use interface
|
47
|
+
- Support for:
|
48
|
+
- Messages
|
49
|
+
- Photos
|
50
|
+
- Documents
|
51
|
+
- Audio
|
52
|
+
- Video
|
53
|
+
- Voice messages
|
54
|
+
- Location
|
55
|
+
- Contact sharing
|
56
|
+
- Inline keyboards
|
57
|
+
- Menu keyboards
|
58
|
+
- Callback queries
|
59
|
+
- Chat administration
|
60
|
+
- Payment system
|
61
|
+
- Database integration
|
62
|
+
|
63
|
+
## Installation
|
64
|
+
|
65
|
+
``pip install pyrobale``
|
66
|
+
|
67
|
+
## Quick Start
|
68
|
+
|
69
|
+
```py
|
70
|
+
from bale import Client, MenuKeyboardMarkup, MenuKeyboardButton
|
71
|
+
|
72
|
+
# Initialize bot with token
|
73
|
+
bot = Client("YOUR_BOT_TOKEN")
|
74
|
+
|
75
|
+
# Handle incoming messages
|
76
|
+
@bot.on_message
|
77
|
+
def handle_message(message):
|
78
|
+
if message.text == "/start":
|
79
|
+
# Create keyboard
|
80
|
+
keyboard = MenuKeyboardMarkup()
|
81
|
+
keyboard.add(MenuKeyboardButton("Hello!"))
|
82
|
+
|
83
|
+
# Send welcome message
|
84
|
+
message.reply_message("Welcome!", reply_markup=keyboard)
|
85
|
+
|
86
|
+
# Start the bot
|
87
|
+
bot.run()
|
88
|
+
```
|
89
|
+
|
90
|
+
## Key Components
|
91
|
+
|
92
|
+
### Client
|
93
|
+
|
94
|
+
The main class for interacting with Bale API. Handles all API requests and provides event decorators.
|
95
|
+
|
96
|
+
### Message
|
97
|
+
|
98
|
+
Represents a message in Bale with methods for replying, editing, and deleting messages.
|
99
|
+
|
100
|
+
### User
|
101
|
+
|
102
|
+
Represents a Bale user with their properties and methods.
|
103
|
+
|
104
|
+
### Chat
|
105
|
+
|
106
|
+
Represents a chat conversation with methods for sending messages and managing chat settings.
|
107
|
+
|
108
|
+
### Keyboards
|
109
|
+
|
110
|
+
- `MenuKeyboardMarkup`: For creating text keyboards
|
111
|
+
- `InlineKeyboardMarkup`: For creating inline keyboards
|
112
|
+
|
113
|
+
### Database
|
114
|
+
|
115
|
+
Built-in SQLite database support for storing persistent data.
|
116
|
+
|
117
|
+
## Event Handlers
|
118
|
+
|
119
|
+
# Message handler
|
120
|
+
|
121
|
+
```python
|
122
|
+
@bot.on_message
|
123
|
+
def handle_message(message):
|
124
|
+
pass
|
125
|
+
```
|
126
|
+
|
127
|
+
# Callback query handler
|
128
|
+
|
129
|
+
```python
|
130
|
+
@bot.on_callback_query
|
131
|
+
def handle_callback(callback):
|
132
|
+
pass
|
133
|
+
```
|
134
|
+
|
135
|
+
# Periodic task handler
|
136
|
+
|
137
|
+
```python
|
138
|
+
@bot.on_tick(60) # Runs every 60 seconds
|
139
|
+
def handle_tick():
|
140
|
+
pass
|
141
|
+
```
|
142
|
+
|
143
|
+
# Ready event handler
|
144
|
+
|
145
|
+
```python
|
146
|
+
@bot.on_ready
|
147
|
+
def handle_ready():
|
148
|
+
pass
|
149
|
+
```
|
150
|
+
|
151
|
+
# Member join handler
|
152
|
+
|
153
|
+
```python
|
154
|
+
@bot.on_member_chat_join
|
155
|
+
def handle_join(message, chat, user):
|
156
|
+
pass
|
157
|
+
```
|
158
|
+
|
159
|
+
# Member leave handler
|
160
|
+
|
161
|
+
```python
|
162
|
+
@bot.on_member_chat_leave
|
163
|
+
def handle_leave(message, chat, user):
|
164
|
+
pass
|
165
|
+
```
|
166
|
+
|
167
|
+
## Database Usage
|
168
|
+
|
169
|
+
# Access database
|
170
|
+
|
171
|
+
```py
|
172
|
+
with bot.database as db:
|
173
|
+
db.write_key("user_123", {"points": 100})
|
174
|
+
|
175
|
+
data = db.read_key("user_123")
|
176
|
+
```
|
@@ -0,0 +1,43 @@
|
|
1
|
+
pyrobale/__init__.py,sha256=JHnoAuKziwl7pysBJLpmXDN4YoKeDXhiL6joscEFh_Y,78
|
2
|
+
pyrobale/client/__init__.py,sha256=ehsCuqAVpJuXzwolZCCcySHZZJawqNT-yr2LIgP52II,21104
|
3
|
+
pyrobale/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
pyrobale/exceptions/common.py,sha256=waAfMFzCsrDr9lS11N0Yzs2v1BX_2ucwV15K1Dq9tYA,159
|
5
|
+
pyrobale/objects/__init__.py,sha256=cQP_MKQH4WeJPjhQHt864jUFEBw7jOwIh2w5pCUbbUE,2132
|
6
|
+
pyrobale/objects/animation.py,sha256=jpM9V8AOaGLWkcENTDmsxKf57Abf-MArYBLfU6GwkD0,978
|
7
|
+
pyrobale/objects/audio.py,sha256=q14wz5WpC3SgKZkAlH-D9M554RYQNDwuCT2z7v7IZYU,696
|
8
|
+
pyrobale/objects/callbackquery.py,sha256=VlogbysCpdPjAIvrF6CvcJeSUco4WKPXjrvUprEaF1g,1281
|
9
|
+
pyrobale/objects/chat.py,sha256=gQ1wpmB63Ot51aeSBAiWzbw9lFgCpJjlm9hlYNBQJ88,16566
|
10
|
+
pyrobale/objects/chatmember.py,sha256=CyoX4R4vkNoPjki7U4tgslmEc51g1nn9Q7tUyPeHa58,6868
|
11
|
+
pyrobale/objects/chatphoto.py,sha256=vOb5xzpr3oBiCloi2_ufBnVlUfmcPqSTmMMMTTBYdJo,533
|
12
|
+
pyrobale/objects/contact.py,sha256=6LDxT5RoGbY5Tsw64lg5-jvKSRmmvOiIJha1HqdTaG4,411
|
13
|
+
pyrobale/objects/copytextbutton.py,sha256=CbFWeY9Ebor7dnHJpQUMB1zYhJWl7b5a2T_cdmo1qQ0,134
|
14
|
+
pyrobale/objects/document.py,sha256=cI9_McPzySNKZaQmOma9eX75a3YsyzkVrLvUBDIuwsA,661
|
15
|
+
pyrobale/objects/enums.py,sha256=O7n5ErPGuhGMd-JdOgJvCqV5q5ukZ2xNsUb0RoEtboA,554
|
16
|
+
pyrobale/objects/file.py,sha256=4PBfjouP0knd1vFDNs7mx_jwBoDQVBKS7ESjzF4Y6E8,360
|
17
|
+
pyrobale/objects/inlinekeyboardbutton.py,sha256=w4HehdisD7RQodS66gG-DJjaf0gO2U-6wYaVXaatTN8,617
|
18
|
+
pyrobale/objects/inlinekeyboardmarkup.py,sha256=shNpYUT25EqT0PQFa-c1tEma_6mJIpBwXQ0IqcTGg4M,2887
|
19
|
+
pyrobale/objects/inputfile.py,sha256=vjw96uJZzp4UargWd2p3OQKyvTpHu2PH_dR_RwwshRI,621
|
20
|
+
pyrobale/objects/inputmedias.py,sha256=2h5YKWNjrrLD1QKZ5J_iOfpCZIRpAZST9q7eBd8edo0,6248
|
21
|
+
pyrobale/objects/invoice.py,sha256=hI225mtsSSV7fYre6aFHp-o1NxUT8MLugJAD6NfAeIs,375
|
22
|
+
pyrobale/objects/keyboardbutton.py,sha256=J7c1ma7swjk3zkgcD7vnMdIMsBGExicmbm1bnP_puzU,459
|
23
|
+
pyrobale/objects/labeledprice.py,sha256=d-fbOLzpkBslfor13BXGeVoySKCcSxsXY4QVwub2Z9o,228
|
24
|
+
pyrobale/objects/location.py,sha256=w_9sRJRntLpNbn8Jk6JhRJVVigD9Bd4BxbjFyglxWhU,143
|
25
|
+
pyrobale/objects/message.py,sha256=5mtVEsC6j8LkwW834IHTEl4AGvoFbKDURjAAV6YUP3E,14094
|
26
|
+
pyrobale/objects/messageid.py,sha256=DrWKV8y9m9H8G_Fj68KgiJKwDJOGduNJGJ-Dyn8N580,95
|
27
|
+
pyrobale/objects/photosize.py,sha256=I4hnmi46uoU-cW7hPN_tTT9kn0u80BtG5QJ3uRjoUiE,298
|
28
|
+
pyrobale/objects/precheckoutquery.py,sha256=Rtjh1qqRc9TRZMJU1W5r0B8y7K5dayLMXX6WH9h1Ul4,470
|
29
|
+
pyrobale/objects/replykeyboardmarkup.py,sha256=3dBiOs29q54tf281qKYcoO1Yjvn63WZfdkrbIoDUfck,1645
|
30
|
+
pyrobale/objects/sticker.py,sha256=yLzWAm1fikMVISExdCG0R-rVu1_M31LLw6sHt0sBehE,381
|
31
|
+
pyrobale/objects/stickerset.py,sha256=xlSdlnb5TCzI_MCkB_bJsZPgELVevbO7R3BAYN2jIt8,269
|
32
|
+
pyrobale/objects/successfulpayment.py,sha256=aEAApcd60dByqPw253jEifG_CVsbLYiphB1ep3CEm2E,502
|
33
|
+
pyrobale/objects/update.py,sha256=cDR9hpcC8r4bJjixgMQD84Dg_-8ZrlZq1HninVVVDuQ,716
|
34
|
+
pyrobale/objects/user.py,sha256=PDPJGq89PARg6Ha38FR1N4ZanpbSMpI_siXh5ZHfsvg,437
|
35
|
+
pyrobale/objects/utils.py,sha256=WVR6eTXbVzTZeNPgb_qNEyGv7ctppTsuAL2c5x48ljo,861
|
36
|
+
pyrobale/objects/video.py,sha256=DuZMGHio_w8yQvi87Vc3XpJOpEaltkM4_bNRSeocPZo,509
|
37
|
+
pyrobale/objects/voice.py,sha256=ZdsJFH2IsBwelEk4rb4oZfX9xrfJ2_DgfjsMc0e4Tmg,148
|
38
|
+
pyrobale/objects/webappdata.py,sha256=QlZlCa8Mylt8VmcdgdoHeyita5CVnz2WsT1yueEY1tY,78
|
39
|
+
pyrobale/objects/webappinfo.py,sha256=qnTvfNqx91Yzbc1gO5y4XQ3w6g0RpMUqMuF5wk_EZMc,75
|
40
|
+
pyrobale-0.3.5.dist-info/METADATA,sha256=Z_bbIivEemBz3HVdg0-X0ObOp4im-VRF1KABsveI7C4,4214
|
41
|
+
pyrobale-0.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
42
|
+
pyrobale-0.3.5.dist-info/licenses/LICENSE,sha256=F8U4JY2aXNJspsrcVW0zf6watzK22FMPTF3NkS36tss,1070
|
43
|
+
pyrobale-0.3.5.dist-info/RECORD,,
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Ali Safamanesh
|
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.
|