Rubka 2.11.13__py3-none-any.whl → 3.3.4__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.
- rubka/adaptorrubka/__init__.py +4 -0
- rubka/adaptorrubka/client/__init__.py +1 -0
- rubka/adaptorrubka/client/client.py +60 -0
- rubka/adaptorrubka/crypto/__init__.py +1 -0
- rubka/adaptorrubka/crypto/crypto.py +82 -0
- rubka/adaptorrubka/enums.py +36 -0
- rubka/adaptorrubka/exceptions.py +22 -0
- rubka/adaptorrubka/methods/__init__.py +1 -0
- rubka/adaptorrubka/methods/methods.py +90 -0
- rubka/adaptorrubka/network/__init__.py +3 -0
- rubka/adaptorrubka/network/helper.py +22 -0
- rubka/adaptorrubka/network/network.py +221 -0
- rubka/adaptorrubka/network/socket.py +16 -0
- rubka/adaptorrubka/sessions/__init__.py +1 -0
- rubka/adaptorrubka/sessions/sessions.py +72 -0
- rubka/adaptorrubka/types/__init__.py +1 -0
- rubka/adaptorrubka/types/socket/__init__.py +1 -0
- rubka/adaptorrubka/types/socket/message.py +187 -0
- rubka/adaptorrubka/utils/__init__.py +2 -0
- rubka/adaptorrubka/utils/configs.py +18 -0
- rubka/adaptorrubka/utils/utils.py +251 -0
- rubka/api.py +58 -0
- rubka/button.py +264 -0
- rubka/keypad.py +255 -5
- {rubka-2.11.13.dist-info → rubka-3.3.4.dist-info}/METADATA +1 -1
- rubka-3.3.4.dist-info/RECORD +37 -0
- rubka-2.11.13.dist-info/RECORD +0 -15
- {rubka-2.11.13.dist-info → rubka-3.3.4.dist-info}/WHEEL +0 -0
- {rubka-2.11.13.dist-info → rubka-3.3.4.dist-info}/top_level.txt +0 -0
rubka/button.py
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional, Union
|
|
4
|
+
from typing import Dict, List, Optional
|
|
5
|
+
|
|
6
|
+
class InlineBuilder:
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.rows: List[Dict] = []
|
|
9
|
+
|
|
10
|
+
def row(self, *buttons: Dict) -> "InlineBuilder":
|
|
11
|
+
"""
|
|
12
|
+
افزودن یک ردیف دکمه به کیبورد
|
|
13
|
+
حداقل یک دکمه باید داده شود.
|
|
14
|
+
"""
|
|
15
|
+
if not buttons:
|
|
16
|
+
raise ValueError("حداقل یک دکمه باید به row داده شود")
|
|
17
|
+
self.rows.append({"buttons": list(buttons)})
|
|
18
|
+
return self
|
|
19
|
+
|
|
20
|
+
def button_simple(self, id: str, text: str) -> Dict:
|
|
21
|
+
return {"id": id, "type": "Simple", "button_text": text}
|
|
22
|
+
|
|
23
|
+
def button_selection(self, id: str, text: str, selection: Dict) -> Dict:
|
|
24
|
+
"""
|
|
25
|
+
selection: dict با فیلدهای:
|
|
26
|
+
- selection_id (str)
|
|
27
|
+
- search_type (str) [ButtonSelectionSearchEnum: None, Local, Api]
|
|
28
|
+
- get_type (str) [ButtonSelectionGetEnum: Local, Api]
|
|
29
|
+
- items (list of ButtonSelectionItem)
|
|
30
|
+
- is_multi_selection (bool)
|
|
31
|
+
- columns_count (str)
|
|
32
|
+
- title (str)
|
|
33
|
+
"""
|
|
34
|
+
return {
|
|
35
|
+
"id": id,
|
|
36
|
+
"type": "Selection",
|
|
37
|
+
"button_text": text,
|
|
38
|
+
"button_selection": selection
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
def button_calendar(self, id: str, title: str, type_: str,
|
|
42
|
+
default_value: Optional[str] = None,
|
|
43
|
+
min_year: Optional[str] = None,
|
|
44
|
+
max_year: Optional[str] = None) -> Dict:
|
|
45
|
+
"""
|
|
46
|
+
type_: ButtonCalendarTypeEnum = "DatePersian" | "DateGregorian"
|
|
47
|
+
"""
|
|
48
|
+
calendar = {
|
|
49
|
+
"title": title,
|
|
50
|
+
"type": type_,
|
|
51
|
+
}
|
|
52
|
+
if default_value:
|
|
53
|
+
calendar["default_value"] = default_value
|
|
54
|
+
if min_year:
|
|
55
|
+
calendar["min_year"] = min_year
|
|
56
|
+
if max_year:
|
|
57
|
+
calendar["max_year"] = max_year
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
"id": id,
|
|
61
|
+
"type": "Calendar",
|
|
62
|
+
"button_text": title,
|
|
63
|
+
"button_calendar": calendar
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
def button_number_picker(self, id: str, title: str, min_value: str, max_value: str,
|
|
67
|
+
default_value: Optional[str] = None) -> Dict:
|
|
68
|
+
picker = {
|
|
69
|
+
"title": title,
|
|
70
|
+
"min_value": min_value,
|
|
71
|
+
"max_value": max_value,
|
|
72
|
+
}
|
|
73
|
+
if default_value:
|
|
74
|
+
picker["default_value"] = default_value
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
"id": id,
|
|
78
|
+
"type": "NumberPicker",
|
|
79
|
+
"button_text": title,
|
|
80
|
+
"button_number_picker": picker
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
def button_string_picker(self, id: str, title: Optional[str], items: List[str],
|
|
84
|
+
default_value: Optional[str] = None) -> Dict:
|
|
85
|
+
picker = {
|
|
86
|
+
"items": items
|
|
87
|
+
}
|
|
88
|
+
if default_value:
|
|
89
|
+
picker["default_value"] = default_value
|
|
90
|
+
if title:
|
|
91
|
+
picker["title"] = title
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
"id": id,
|
|
95
|
+
"type": "StringPicker",
|
|
96
|
+
"button_text": title if title else "انتخاب",
|
|
97
|
+
"button_string_picker": picker
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
def button_location(self, id: str, type_: str, location_image_url: str,
|
|
101
|
+
default_pointer_location: Optional[Dict] = None,
|
|
102
|
+
default_map_location: Optional[Dict] = None,
|
|
103
|
+
title: Optional[str] = None) -> Dict:
|
|
104
|
+
"""
|
|
105
|
+
type_: ButtonLocationTypeEnum = "Picker" | "View"
|
|
106
|
+
location_image_url: str آدرس عکس دکمه موقعیت
|
|
107
|
+
default_pointer_location و default_map_location هر کدام دیکشنری Location (latitude, longitude)
|
|
108
|
+
"""
|
|
109
|
+
loc = {
|
|
110
|
+
"type": type_,
|
|
111
|
+
"location_image_url": location_image_url,
|
|
112
|
+
}
|
|
113
|
+
if default_pointer_location:
|
|
114
|
+
loc["default_pointer_location"] = default_pointer_location
|
|
115
|
+
if default_map_location:
|
|
116
|
+
loc["default_map_location"] = default_map_location
|
|
117
|
+
if title:
|
|
118
|
+
loc["title"] = title
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
"id": id,
|
|
122
|
+
"type": "Location",
|
|
123
|
+
"button_text": title if title else "موقعیت مکانی",
|
|
124
|
+
"button_location": loc
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
def button_textbox(self, id: str, title: Optional[str],
|
|
128
|
+
type_line: str, type_keypad: str,
|
|
129
|
+
place_holder: Optional[str] = None,
|
|
130
|
+
default_value: Optional[str] = None) -> Dict:
|
|
131
|
+
"""
|
|
132
|
+
type_line: ButtonTextboxTypeLineEnum = "SingleLine" | "MultiLine"
|
|
133
|
+
type_keypad: ButtonTextboxTypeKeypadEnum = "String" | "Number"
|
|
134
|
+
"""
|
|
135
|
+
textbox = {
|
|
136
|
+
"type_line": type_line,
|
|
137
|
+
"type_keypad": type_keypad
|
|
138
|
+
}
|
|
139
|
+
if place_holder:
|
|
140
|
+
textbox["place_holder"] = place_holder
|
|
141
|
+
if default_value:
|
|
142
|
+
textbox["default_value"] = default_value
|
|
143
|
+
if title:
|
|
144
|
+
textbox["title"] = title
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
"id": id,
|
|
148
|
+
"type": "Textbox",
|
|
149
|
+
"button_text": title if title else "متن",
|
|
150
|
+
"button_textbox": textbox
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
def button_payment(self, id: str, title: str, amount: int, description: Optional[str] = None) -> Dict:
|
|
154
|
+
"""
|
|
155
|
+
نمونهای ساده برای دکمه پرداخت (مقدار و توضیح دلخواه)
|
|
156
|
+
"""
|
|
157
|
+
payment = {
|
|
158
|
+
"title": title,
|
|
159
|
+
"amount": amount
|
|
160
|
+
}
|
|
161
|
+
if description:
|
|
162
|
+
payment["description"] = description
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
"id": id,
|
|
166
|
+
"type": "Payment",
|
|
167
|
+
"button_text": title,
|
|
168
|
+
"button_payment": payment
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
def button_camera_image(self, id: str, title: str) -> Dict:
|
|
172
|
+
return {
|
|
173
|
+
"id": id,
|
|
174
|
+
"type": "CameraImage",
|
|
175
|
+
"button_text": title
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
def button_camera_video(self, id: str, title: str) -> Dict:
|
|
179
|
+
return {
|
|
180
|
+
"id": id,
|
|
181
|
+
"type": "CameraVideo",
|
|
182
|
+
"button_text": title
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
def button_gallery_image(self, id: str, title: str) -> Dict:
|
|
186
|
+
return {
|
|
187
|
+
"id": id,
|
|
188
|
+
"type": "GalleryImage",
|
|
189
|
+
"button_text": title
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
def button_gallery_video(self, id: str, title: str) -> Dict:
|
|
193
|
+
return {
|
|
194
|
+
"id": id,
|
|
195
|
+
"type": "GalleryVideo",
|
|
196
|
+
"button_text": title
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
def button_file(self, id: str, title: str) -> Dict:
|
|
200
|
+
return {
|
|
201
|
+
"id": id,
|
|
202
|
+
"type": "File",
|
|
203
|
+
"button_text": title
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
def button_audio(self, id: str, title: str) -> Dict:
|
|
207
|
+
return {
|
|
208
|
+
"id": id,
|
|
209
|
+
"type": "Audio",
|
|
210
|
+
"button_text": title
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
def button_record_audio(self, id: str, title: str) -> Dict:
|
|
214
|
+
return {
|
|
215
|
+
"id": id,
|
|
216
|
+
"type": "RecordAudio",
|
|
217
|
+
"button_text": title
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
def button_my_phone_number(self, id: str, title: str) -> Dict:
|
|
221
|
+
return {
|
|
222
|
+
"id": id,
|
|
223
|
+
"type": "MyPhoneNumber",
|
|
224
|
+
"button_text": title
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
def button_my_location(self, id: str, title: str) -> Dict:
|
|
228
|
+
return {
|
|
229
|
+
"id": id,
|
|
230
|
+
"type": "MyLocation",
|
|
231
|
+
"button_text": title
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
def button_link(self, id: str, title: str, url: str) -> Dict:
|
|
235
|
+
return {
|
|
236
|
+
"id": id,
|
|
237
|
+
"type": "Link",
|
|
238
|
+
"button_text": title,
|
|
239
|
+
"url": url
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
def button_ask_my_phone_number(self, id: str, title: str) -> Dict:
|
|
243
|
+
return {
|
|
244
|
+
"id": id,
|
|
245
|
+
"type": "AskMyPhoneNumber",
|
|
246
|
+
"button_text": title
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
def button_ask_location(self, id: str, title: str) -> Dict:
|
|
250
|
+
return {
|
|
251
|
+
"id": id,
|
|
252
|
+
"type": "AskLocation",
|
|
253
|
+
"button_text": title
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
def button_barcode(self, id: str, title: str) -> Dict:
|
|
257
|
+
return {
|
|
258
|
+
"id": id,
|
|
259
|
+
"type": "Barcode",
|
|
260
|
+
"button_text": title
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
def build(self) -> Dict:
|
|
264
|
+
return {"rows": self.rows}
|
rubka/keypad.py
CHANGED
|
@@ -1,18 +1,268 @@
|
|
|
1
1
|
from typing import Dict
|
|
2
2
|
|
|
3
|
+
from typing import Dict, List, Optional, Union
|
|
4
|
+
from typing import Dict, List, Optional
|
|
5
|
+
|
|
3
6
|
class InlineBuilder:
|
|
4
7
|
def __init__(self):
|
|
5
|
-
self.rows = []
|
|
8
|
+
self.rows: List[Dict] = []
|
|
6
9
|
|
|
7
|
-
def row(self, *buttons: Dict
|
|
10
|
+
def row(self, *buttons: Dict) -> "InlineBuilder":
|
|
11
|
+
"""
|
|
12
|
+
افزودن یک ردیف دکمه به کیبورد
|
|
13
|
+
حداقل یک دکمه باید داده شود.
|
|
14
|
+
"""
|
|
15
|
+
if not buttons:
|
|
16
|
+
raise ValueError("حداقل یک دکمه باید به row داده شود")
|
|
8
17
|
self.rows.append({"buttons": list(buttons)})
|
|
9
18
|
return self
|
|
10
19
|
|
|
11
|
-
def
|
|
12
|
-
return {"id": id, "type":
|
|
20
|
+
def button_simple(self, id: str, text: str) -> Dict:
|
|
21
|
+
return {"id": id, "type": "Simple", "button_text": text}
|
|
22
|
+
|
|
23
|
+
def button_selection(self, id: str, text: str, selection: Dict) -> Dict:
|
|
24
|
+
"""
|
|
25
|
+
selection: dict با فیلدهای:
|
|
26
|
+
- selection_id (str)
|
|
27
|
+
- search_type (str) [ButtonSelectionSearchEnum: None, Local, Api]
|
|
28
|
+
- get_type (str) [ButtonSelectionGetEnum: Local, Api]
|
|
29
|
+
- items (list of ButtonSelectionItem)
|
|
30
|
+
- is_multi_selection (bool)
|
|
31
|
+
- columns_count (str)
|
|
32
|
+
- title (str)
|
|
33
|
+
"""
|
|
34
|
+
return {
|
|
35
|
+
"id": id,
|
|
36
|
+
"type": "Selection",
|
|
37
|
+
"button_text": text,
|
|
38
|
+
"button_selection": selection
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
def button_calendar(self, id: str, title: str, type_: str,
|
|
42
|
+
default_value: Optional[str] = None,
|
|
43
|
+
min_year: Optional[str] = None,
|
|
44
|
+
max_year: Optional[str] = None) -> Dict:
|
|
45
|
+
"""
|
|
46
|
+
type_: ButtonCalendarTypeEnum = "DatePersian" | "DateGregorian"
|
|
47
|
+
"""
|
|
48
|
+
calendar = {
|
|
49
|
+
"title": title,
|
|
50
|
+
"type": type_,
|
|
51
|
+
}
|
|
52
|
+
if default_value:
|
|
53
|
+
calendar["default_value"] = default_value
|
|
54
|
+
if min_year:
|
|
55
|
+
calendar["min_year"] = min_year
|
|
56
|
+
if max_year:
|
|
57
|
+
calendar["max_year"] = max_year
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
"id": id,
|
|
61
|
+
"type": "Calendar",
|
|
62
|
+
"button_text": title,
|
|
63
|
+
"button_calendar": calendar
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
def button_number_picker(self, id: str, title: str, min_value: str, max_value: str,
|
|
67
|
+
default_value: Optional[str] = None) -> Dict:
|
|
68
|
+
picker = {
|
|
69
|
+
"title": title,
|
|
70
|
+
"min_value": min_value,
|
|
71
|
+
"max_value": max_value,
|
|
72
|
+
}
|
|
73
|
+
if default_value:
|
|
74
|
+
picker["default_value"] = default_value
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
"id": id,
|
|
78
|
+
"type": "NumberPicker",
|
|
79
|
+
"button_text": title,
|
|
80
|
+
"button_number_picker": picker
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
def button_string_picker(self, id: str, title: Optional[str], items: List[str],
|
|
84
|
+
default_value: Optional[str] = None) -> Dict:
|
|
85
|
+
picker = {
|
|
86
|
+
"items": items
|
|
87
|
+
}
|
|
88
|
+
if default_value:
|
|
89
|
+
picker["default_value"] = default_value
|
|
90
|
+
if title:
|
|
91
|
+
picker["title"] = title
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
"id": id,
|
|
95
|
+
"type": "StringPicker",
|
|
96
|
+
"button_text": title if title else "انتخاب",
|
|
97
|
+
"button_string_picker": picker
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
def button_location(self, id: str, type_: str, location_image_url: str,
|
|
101
|
+
default_pointer_location: Optional[Dict] = None,
|
|
102
|
+
default_map_location: Optional[Dict] = None,
|
|
103
|
+
title: Optional[str] = None) -> Dict:
|
|
104
|
+
"""
|
|
105
|
+
type_: ButtonLocationTypeEnum = "Picker" | "View"
|
|
106
|
+
location_image_url: str آدرس عکس دکمه موقعیت
|
|
107
|
+
default_pointer_location و default_map_location هر کدام دیکشنری Location (latitude, longitude)
|
|
108
|
+
"""
|
|
109
|
+
loc = {
|
|
110
|
+
"type": type_,
|
|
111
|
+
"location_image_url": location_image_url,
|
|
112
|
+
}
|
|
113
|
+
if default_pointer_location:
|
|
114
|
+
loc["default_pointer_location"] = default_pointer_location
|
|
115
|
+
if default_map_location:
|
|
116
|
+
loc["default_map_location"] = default_map_location
|
|
117
|
+
if title:
|
|
118
|
+
loc["title"] = title
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
"id": id,
|
|
122
|
+
"type": "Location",
|
|
123
|
+
"button_text": title if title else "موقعیت مکانی",
|
|
124
|
+
"button_location": loc
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
def button_textbox(self, id: str, title: Optional[str],
|
|
128
|
+
type_line: str, type_keypad: str,
|
|
129
|
+
place_holder: Optional[str] = None,
|
|
130
|
+
default_value: Optional[str] = None) -> Dict:
|
|
131
|
+
"""
|
|
132
|
+
type_line: ButtonTextboxTypeLineEnum = "SingleLine" | "MultiLine"
|
|
133
|
+
type_keypad: ButtonTextboxTypeKeypadEnum = "String" | "Number"
|
|
134
|
+
"""
|
|
135
|
+
textbox = {
|
|
136
|
+
"type_line": type_line,
|
|
137
|
+
"type_keypad": type_keypad
|
|
138
|
+
}
|
|
139
|
+
if place_holder:
|
|
140
|
+
textbox["place_holder"] = place_holder
|
|
141
|
+
if default_value:
|
|
142
|
+
textbox["default_value"] = default_value
|
|
143
|
+
if title:
|
|
144
|
+
textbox["title"] = title
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
"id": id,
|
|
148
|
+
"type": "Textbox",
|
|
149
|
+
"button_text": title if title else "متن",
|
|
150
|
+
"button_textbox": textbox
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
def button_payment(self, id: str, title: str, amount: int, description: Optional[str] = None) -> Dict:
|
|
154
|
+
"""
|
|
155
|
+
نمونهای ساده برای دکمه پرداخت (مقدار و توضیح دلخواه)
|
|
156
|
+
"""
|
|
157
|
+
payment = {
|
|
158
|
+
"title": title,
|
|
159
|
+
"amount": amount
|
|
160
|
+
}
|
|
161
|
+
if description:
|
|
162
|
+
payment["description"] = description
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
"id": id,
|
|
166
|
+
"type": "Payment",
|
|
167
|
+
"button_text": title,
|
|
168
|
+
"button_payment": payment
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
def button_camera_image(self, id: str, title: str) -> Dict:
|
|
172
|
+
return {
|
|
173
|
+
"id": id,
|
|
174
|
+
"type": "CameraImage",
|
|
175
|
+
"button_text": title
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
def button_camera_video(self, id: str, title: str) -> Dict:
|
|
179
|
+
return {
|
|
180
|
+
"id": id,
|
|
181
|
+
"type": "CameraVideo",
|
|
182
|
+
"button_text": title
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
def button_gallery_image(self, id: str, title: str) -> Dict:
|
|
186
|
+
return {
|
|
187
|
+
"id": id,
|
|
188
|
+
"type": "GalleryImage",
|
|
189
|
+
"button_text": title
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
def button_gallery_video(self, id: str, title: str) -> Dict:
|
|
193
|
+
return {
|
|
194
|
+
"id": id,
|
|
195
|
+
"type": "GalleryVideo",
|
|
196
|
+
"button_text": title
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
def button_file(self, id: str, title: str) -> Dict:
|
|
200
|
+
return {
|
|
201
|
+
"id": id,
|
|
202
|
+
"type": "File",
|
|
203
|
+
"button_text": title
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
def button_audio(self, id: str, title: str) -> Dict:
|
|
207
|
+
return {
|
|
208
|
+
"id": id,
|
|
209
|
+
"type": "Audio",
|
|
210
|
+
"button_text": title
|
|
211
|
+
}
|
|
13
212
|
|
|
14
|
-
def
|
|
213
|
+
def button_record_audio(self, id: str, title: str) -> Dict:
|
|
214
|
+
return {
|
|
215
|
+
"id": id,
|
|
216
|
+
"type": "RecordAudio",
|
|
217
|
+
"button_text": title
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
def button_my_phone_number(self, id: str, title: str) -> Dict:
|
|
221
|
+
return {
|
|
222
|
+
"id": id,
|
|
223
|
+
"type": "MyPhoneNumber",
|
|
224
|
+
"button_text": title
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
def button_my_location(self, id: str, title: str) -> Dict:
|
|
228
|
+
return {
|
|
229
|
+
"id": id,
|
|
230
|
+
"type": "MyLocation",
|
|
231
|
+
"button_text": title
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
def button_link(self, id: str, title: str, url: str) -> Dict:
|
|
235
|
+
return {
|
|
236
|
+
"id": id,
|
|
237
|
+
"type": "Link",
|
|
238
|
+
"button_text": title,
|
|
239
|
+
"url": url
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
def button_ask_my_phone_number(self, id: str, title: str) -> Dict:
|
|
243
|
+
return {
|
|
244
|
+
"id": id,
|
|
245
|
+
"type": "AskMyPhoneNumber",
|
|
246
|
+
"button_text": title
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
def button_ask_location(self, id: str, title: str) -> Dict:
|
|
250
|
+
return {
|
|
251
|
+
"id": id,
|
|
252
|
+
"type": "AskLocation",
|
|
253
|
+
"button_text": title
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
def button_barcode(self, id: str, title: str) -> Dict:
|
|
257
|
+
return {
|
|
258
|
+
"id": id,
|
|
259
|
+
"type": "Barcode",
|
|
260
|
+
"button_text": title
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
def build(self) -> Dict:
|
|
15
264
|
return {"rows": self.rows}
|
|
265
|
+
|
|
16
266
|
from typing import List, Dict, Optional
|
|
17
267
|
|
|
18
268
|
class ChatKeypadBuilder:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Rubka
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.3.4
|
|
4
4
|
Summary: A Python library for interacting with Rubika Bot API.
|
|
5
5
|
Home-page: https://github.com/Mahdy-Ahmadi/Rubka
|
|
6
6
|
Download-URL: https://github.com/Mahdy-Ahmadi/Rubka/archive/refs/tags/v0.1.0.tar.gz
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
rubka/__init__.py,sha256=3f4H6Uj1ylrfBYlTHmTvzZSvaPJsdNhCocyX3Bbvuv0,254
|
|
2
|
+
rubka/api.py,sha256=C1LImvk-0SWhU8g1Lhs_9h-gD_mbWVAjNuZoCQ9duhg,15489
|
|
3
|
+
rubka/button.py,sha256=4fMSZR7vUADxSmw1R3_pZ4dw5uMLZX5sOkwPPyNTBDE,8437
|
|
4
|
+
rubka/config.py,sha256=Bck59xkOiqioLv0GkQ1qPGnBXVctz1hKk6LT4h2EPx0,78
|
|
5
|
+
rubka/context.py,sha256=5OMFjcnMWvkn3ZigRgJrjMiFt_tYgMwzHsTS6qXMGj8,12843
|
|
6
|
+
rubka/decorators.py,sha256=hGwUoE4q2ImrunJIGJ_kzGYYxQf1ueE0isadqraKEts,1157
|
|
7
|
+
rubka/exceptions.py,sha256=tujZt1XrhWaw-lmdeVadVceUptpw4XzNgE44sAAY0gs,90
|
|
8
|
+
rubka/jobs.py,sha256=GvLMLsVhcSEzRTgkvnPISPEBN71suW2xXI0hUaUZPTo,378
|
|
9
|
+
rubka/keyboards.py,sha256=7nr-dT2bQJVQnQ6RMWPTSjML6EEk6dsBx-4d8pab8xk,488
|
|
10
|
+
rubka/keypad.py,sha256=yGsNt8W5HtUFBzVF1m_p7GySlu1hwIcSvXZ4BTdrlvg,9558
|
|
11
|
+
rubka/logger.py,sha256=J2I6NiK1z32lrAzC4H1Et6WPMBXxXGCVUsW4jgcAofs,289
|
|
12
|
+
rubka/utils.py,sha256=XUQUZxQt9J2f0X5hmAH_MH1kibTAfdT1T4AaBkBhBBs,148
|
|
13
|
+
rubka/adaptorrubka/__init__.py,sha256=6o2tCXnVeES7nx-LjnzsuMqjKcWIm9qwKficLE54s-U,83
|
|
14
|
+
rubka/adaptorrubka/enums.py,sha256=cyiakExmZi-QQpYuf_A93HQvfZVmyG_0uVuvTTNT5To,1053
|
|
15
|
+
rubka/adaptorrubka/exceptions.py,sha256=UOqfsDdevjByBENGoywDDU-aEa9jVu9-cqhe1Nk3H1c,696
|
|
16
|
+
rubka/adaptorrubka/client/__init__.py,sha256=_5xoxBvqik7-PeMx5hwvFygQoUHpV34lQIJj__e4LaA,26
|
|
17
|
+
rubka/adaptorrubka/client/client.py,sha256=qjvDiLQ10YuG9QM117IEaaMTIjTFU_2otCPCLlrD4rY,2144
|
|
18
|
+
rubka/adaptorrubka/crypto/__init__.py,sha256=sp7mAs_5E02thg6KKcDRBJlQFV94GVp6GUhtwQyC5uA,28
|
|
19
|
+
rubka/adaptorrubka/crypto/crypto.py,sha256=VVucnuRFzq0ifLpbcfhSkpxhCLnNp3fuYA7BmUja2gQ,2937
|
|
20
|
+
rubka/adaptorrubka/methods/__init__.py,sha256=LmkMe1KZw2_cI5vcJU2-yeTqKh0e0Q9-x0IXE4GAu5c,28
|
|
21
|
+
rubka/adaptorrubka/methods/methods.py,sha256=NNG-Yz2vQhCD5eAfg_HeRyItMTfJ6bDox-ofVFY4Bv4,3328
|
|
22
|
+
rubka/adaptorrubka/network/__init__.py,sha256=5xXuNp0ezvGWen1cAveCnZURwijbJE4PHPhi7W1TlDE,84
|
|
23
|
+
rubka/adaptorrubka/network/helper.py,sha256=Z93cO55mFPvwioCRrIJ_KMYLH9bQQUbAU9CnpsBg0qM,601
|
|
24
|
+
rubka/adaptorrubka/network/network.py,sha256=bvVcBQkj0MepSGxSJhLyJKL6uzeqg8qp93CtY0Z9HoY,8016
|
|
25
|
+
rubka/adaptorrubka/network/socket.py,sha256=r6w_QlVmZSbTWXK6XBAUmEBIH0RAx-LMNDu4ecfk6Is,408
|
|
26
|
+
rubka/adaptorrubka/sessions/__init__.py,sha256=8C_ePDLehLR7i9sSQf8hNq2U6VutWj7uQcMLRPongB8,30
|
|
27
|
+
rubka/adaptorrubka/sessions/sessions.py,sha256=Jhv_qK6wO8PHiFZbe03Eu06Vb-rcpBa9pJyimfPdSuE,2789
|
|
28
|
+
rubka/adaptorrubka/types/__init__.py,sha256=1AgTiALztqwPKinMmblRhiJe9eL1ey8VkOW7WfbC2i8,27
|
|
29
|
+
rubka/adaptorrubka/types/socket/__init__.py,sha256=gYbUzbYeqszb3RIHtQu6P2jSEqgY8a8D1JjAioC15wM,28
|
|
30
|
+
rubka/adaptorrubka/types/socket/message.py,sha256=0WgLMZh4eow8Zn7AiSX4C3GZjQTkIgtk-nCwmPLTa8Y,6866
|
|
31
|
+
rubka/adaptorrubka/utils/__init__.py,sha256=OgCFkXdNFh379quNwIVOAWY2NP5cIOxU5gDRRALTk4o,54
|
|
32
|
+
rubka/adaptorrubka/utils/configs.py,sha256=nMUEOJh1NqDJsf9W9PurkN_DLYjO6kKPMm923i4Jj_A,492
|
|
33
|
+
rubka/adaptorrubka/utils/utils.py,sha256=5-LioLNYX_TIbQGDeT50j7Sg9nAWH2LJUUs-iEXpsUY,8816
|
|
34
|
+
rubka-3.3.4.dist-info/METADATA,sha256=tN6zlYf45FxI_wpHNI7IITcOs0CRZPTR5fNdiyXYIpY,8168
|
|
35
|
+
rubka-3.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
rubka-3.3.4.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
|
|
37
|
+
rubka-3.3.4.dist-info/RECORD,,
|
rubka-2.11.13.dist-info/RECORD
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
rubka/__init__.py,sha256=3f4H6Uj1ylrfBYlTHmTvzZSvaPJsdNhCocyX3Bbvuv0,254
|
|
2
|
-
rubka/api.py,sha256=bF3lyXS7D3wxjdgxKkiiplfWY3fNGo6ORv4WQhdkAgU,13399
|
|
3
|
-
rubka/config.py,sha256=Bck59xkOiqioLv0GkQ1qPGnBXVctz1hKk6LT4h2EPx0,78
|
|
4
|
-
rubka/context.py,sha256=5OMFjcnMWvkn3ZigRgJrjMiFt_tYgMwzHsTS6qXMGj8,12843
|
|
5
|
-
rubka/decorators.py,sha256=hGwUoE4q2ImrunJIGJ_kzGYYxQf1ueE0isadqraKEts,1157
|
|
6
|
-
rubka/exceptions.py,sha256=tujZt1XrhWaw-lmdeVadVceUptpw4XzNgE44sAAY0gs,90
|
|
7
|
-
rubka/jobs.py,sha256=GvLMLsVhcSEzRTgkvnPISPEBN71suW2xXI0hUaUZPTo,378
|
|
8
|
-
rubka/keyboards.py,sha256=7nr-dT2bQJVQnQ6RMWPTSjML6EEk6dsBx-4d8pab8xk,488
|
|
9
|
-
rubka/keypad.py,sha256=FHe0xVYhOXMdHZhbGKHsRxtsRB27qZv0DvNfb8NkNwI,1545
|
|
10
|
-
rubka/logger.py,sha256=J2I6NiK1z32lrAzC4H1Et6WPMBXxXGCVUsW4jgcAofs,289
|
|
11
|
-
rubka/utils.py,sha256=XUQUZxQt9J2f0X5hmAH_MH1kibTAfdT1T4AaBkBhBBs,148
|
|
12
|
-
rubka-2.11.13.dist-info/METADATA,sha256=Iz2JhjVfJBk5pOq1eXG4GcwQsT7pUpG24JzU-GSdkD0,8170
|
|
13
|
-
rubka-2.11.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
-
rubka-2.11.13.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
|
|
15
|
-
rubka-2.11.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|