RubigramClient 1.7.1__py3-none-any.whl → 1.7.2__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.
Potentially problematic release.
This version of RubigramClient might be problematic. Click here for more details.
- rubigram/__init__.py +1 -5
- rubigram/client.py +102 -154
- rubigram/enums.py +4 -3
- rubigram/filters.py +600 -139
- rubigram/handler.py +24 -0
- rubigram/http.py +32 -0
- rubigram/logger.py +20 -0
- rubigram/method/__init__.py +18 -0
- rubigram/method/chat/__init__.py +10 -0
- rubigram/method/chat/get_chat.py +26 -0
- rubigram/method/chat/get_me.py +22 -0
- rubigram/method/chat/get_update.py +32 -0
- rubigram/method/decorator/__init__.py +8 -0
- rubigram/method/decorator/on_delete_message.py +37 -0
- rubigram/method/decorator/on_edit_message.py +37 -0
- rubigram/method/decorator/on_inline_message.py +40 -0
- rubigram/method/decorator/on_message.py +38 -0
- rubigram/method/decorator/on_start.py +30 -0
- rubigram/method/decorator/on_stop.py +29 -0
- rubigram/method/decorator/register.py +43 -0
- rubigram/method/file/__init__.py +32 -0
- rubigram/method/file/download_file.py +34 -0
- rubigram/method/file/get_bytes.py +25 -0
- rubigram/method/file/get_file.py +27 -0
- rubigram/method/file/get_file_name.py +29 -0
- rubigram/method/file/request_download_file.py +35 -0
- rubigram/method/file/request_send_file.py +28 -0
- rubigram/method/file/request_upload_file.py +62 -0
- rubigram/method/file/send_document.py +58 -0
- rubigram/method/file/send_file.py +78 -0
- rubigram/method/file/send_gif.py +58 -0
- rubigram/method/file/send_music.py +58 -0
- rubigram/method/file/send_photo.py +58 -0
- rubigram/method/file/send_video.py +58 -0
- rubigram/method/file/send_voice.py +55 -0
- rubigram/method/messages/__init__.py +29 -0
- rubigram/method/messages/delete_message.py +50 -0
- rubigram/method/messages/edit_chat_keypad.py +34 -0
- rubigram/method/messages/edit_message.py +41 -0
- rubigram/method/messages/edit_message_keypad.py +38 -0
- rubigram/method/messages/edit_message_text.py +34 -0
- rubigram/method/messages/forward_message.py +43 -0
- rubigram/method/messages/remove_chat_keypad.py +28 -0
- rubigram/method/messages/send_contact.py +74 -0
- rubigram/method/messages/send_location.py +70 -0
- rubigram/method/messages/send_message.py +67 -0
- rubigram/method/messages/send_poll.py +71 -0
- rubigram/method/messages/send_sticker.py +66 -0
- rubigram/method/network/__init__.py +7 -0
- rubigram/method/network/request.py +20 -0
- rubigram/method/setting/__init__.py +9 -0
- rubigram/method/setting/set_command.py +32 -0
- rubigram/method/setting/update_bot_endpoint.py +31 -0
- rubigram/method/utilities/__init__.py +11 -0
- rubigram/method/utilities/dispatch.py +25 -0
- rubigram/method/utilities/setup_endpoint.py +16 -0
- rubigram/method/utilities/updater.py +17 -0
- rubigram/state.py +14 -19
- rubigram/types/__init__.py +3 -0
- rubigram/types/messages.py +175 -0
- rubigram/types/object.py +112 -0
- rubigram/types/types.py +211 -0
- rubigram/types/updates.py +572 -0
- {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.2.dist-info}/METADATA +4 -3
- rubigramclient-1.7.2.dist-info/RECORD +68 -0
- rubigram/method.py +0 -354
- rubigram/network.py +0 -80
- rubigram/rubino/__init__.py +0 -1
- rubigram/rubino/client.py +0 -480
- rubigram/types.py +0 -538
- rubigramclient-1.7.1.dist-info/RECORD +0 -15
- {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.2.dist-info}/WHEEL +0 -0
- {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.2.dist-info}/licenses/LICENSE +0 -0
- {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.2.dist-info}/top_level.txt +0 -0
rubigram/types.py
DELETED
|
@@ -1,538 +0,0 @@
|
|
|
1
|
-
from typing import Optional, Union, TypeVar, Type, get_origin, get_args
|
|
2
|
-
from dataclasses import dataclass, fields
|
|
3
|
-
from rubigram import enums
|
|
4
|
-
from json import dumps
|
|
5
|
-
import rubigram
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
T = TypeVar("T", bound="DataManager")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@dataclass
|
|
12
|
-
class DataManager:
|
|
13
|
-
|
|
14
|
-
def asdict(self):
|
|
15
|
-
data = {}
|
|
16
|
-
for field in fields(self):
|
|
17
|
-
if field.name == "client": continue
|
|
18
|
-
value = getattr(self, field.name)
|
|
19
|
-
if isinstance(value, DataManager):
|
|
20
|
-
data[field.name] = value.asdict()
|
|
21
|
-
elif isinstance(value, list):
|
|
22
|
-
data[field.name] = [
|
|
23
|
-
v.asdict() if isinstance(v, DataManager) else v for v in value if v is not None
|
|
24
|
-
]
|
|
25
|
-
else:
|
|
26
|
-
data[field.name] = value
|
|
27
|
-
return data
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def asjson(self, remove_none: Optional[bool] = False):
|
|
31
|
-
def clear(object):
|
|
32
|
-
if isinstance(object, dict):
|
|
33
|
-
return {key: clear(value) for key, value in object.items() if value is not None}
|
|
34
|
-
elif isinstance(object, list):
|
|
35
|
-
return [clear(i) for i in object if i is not None]
|
|
36
|
-
else:
|
|
37
|
-
return object
|
|
38
|
-
|
|
39
|
-
data = self.asdict().copy()
|
|
40
|
-
data.pop("client", None)
|
|
41
|
-
if remove_none:
|
|
42
|
-
data = clear(data)
|
|
43
|
-
return dumps(data, ensure_ascii=False, indent=4)
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
def from_dict(cls: Type[T], data: dict) -> T:
|
|
47
|
-
data = data or {}
|
|
48
|
-
init_data = {}
|
|
49
|
-
|
|
50
|
-
for field in fields(cls):
|
|
51
|
-
value = data.get(field.name)
|
|
52
|
-
field_type = field.type
|
|
53
|
-
origin = get_origin(field_type)
|
|
54
|
-
|
|
55
|
-
if isinstance(value, dict) and isinstance(field_type, type) and issubclass(field_type, DataManager):
|
|
56
|
-
init_data[field.name] = field_type.from_dict(value)
|
|
57
|
-
|
|
58
|
-
elif origin == list:
|
|
59
|
-
inner_type = get_args(field_type)[0]
|
|
60
|
-
if isinstance(inner_type, type) and issubclass(inner_type, DataManager):
|
|
61
|
-
init_data[field.name] = [
|
|
62
|
-
inner_type.from_dict(v) if isinstance(v, dict) else v for v in (value or [])
|
|
63
|
-
]
|
|
64
|
-
else:
|
|
65
|
-
init_data[field.name] = value or []
|
|
66
|
-
|
|
67
|
-
elif origin == Union:
|
|
68
|
-
args = get_args(field_type)
|
|
69
|
-
dict_type = next((
|
|
70
|
-
a for a in args if isinstance(a, type) and issubclass(a, DataManager)
|
|
71
|
-
), None)
|
|
72
|
-
if dict_type and isinstance(value, dict):
|
|
73
|
-
init_data[field.name] = dict_type.from_dict(value)
|
|
74
|
-
else:
|
|
75
|
-
init_data[field.name] = value
|
|
76
|
-
|
|
77
|
-
else:
|
|
78
|
-
init_data[field.name] = value
|
|
79
|
-
|
|
80
|
-
return cls(**init_data)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
@dataclass
|
|
84
|
-
class Chat(DataManager):
|
|
85
|
-
chat_id: Optional[str] = None
|
|
86
|
-
chat_type: Optional[enums.ChatType] = None
|
|
87
|
-
user_id: Optional[str] = None
|
|
88
|
-
first_name: Optional[str] = None
|
|
89
|
-
last_name: Optional[str] = None
|
|
90
|
-
title: Optional[str] = None
|
|
91
|
-
username: Optional[str] = None
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
@dataclass
|
|
95
|
-
class File(DataManager):
|
|
96
|
-
file_id: Optional[str] = None
|
|
97
|
-
file_name: Optional[str] = None
|
|
98
|
-
size: Optional[int] = None
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@dataclass
|
|
102
|
-
class ForwardedFrom(DataManager):
|
|
103
|
-
type_from: Optional[enums.ForwardedFrom] = None
|
|
104
|
-
message_id: Optional[str] = None
|
|
105
|
-
from_chat_id: Optional[str] = None
|
|
106
|
-
from_sender_id: Optional[str] = None
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@dataclass
|
|
110
|
-
class PaymentStatus(DataManager):
|
|
111
|
-
payment_id: Optional[str] = None
|
|
112
|
-
status: Optional[enums.PaymentStatus] = None
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
@dataclass
|
|
116
|
-
class MessageTextUpdate(DataManager):
|
|
117
|
-
message_id: Optional[str] = None
|
|
118
|
-
text: Optional[str] = None
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
@dataclass
|
|
122
|
-
class Bot(DataManager):
|
|
123
|
-
bot_id: Optional[str] = None
|
|
124
|
-
bot_title: Optional[str] = None
|
|
125
|
-
avatar: Optional[File] = None
|
|
126
|
-
description: Optional[str] = None
|
|
127
|
-
username: Optional[str] = None
|
|
128
|
-
start_message: Optional[str] = None
|
|
129
|
-
share_url: Optional[str] = None
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
@dataclass
|
|
133
|
-
class BotCommand(DataManager):
|
|
134
|
-
command: Optional[str] = None
|
|
135
|
-
description: Optional[str] = None
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
@dataclass
|
|
139
|
-
class Sticker(DataManager):
|
|
140
|
-
sticker_id: Optional[str] = None
|
|
141
|
-
file: Optional[File] = None
|
|
142
|
-
emoji_character: Optional[str] = None
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
@dataclass
|
|
146
|
-
class ContactMessage(DataManager):
|
|
147
|
-
phone_number: Optional[str] = None
|
|
148
|
-
first_name: Optional[str] = None
|
|
149
|
-
last_name: Optional[str] = None
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
@dataclass
|
|
153
|
-
class PollStatus(DataManager):
|
|
154
|
-
state: Optional[enums.PollStatus] = None
|
|
155
|
-
selection_index: Optional[int] = None
|
|
156
|
-
percent_vote_options: Optional[list[int]] = None
|
|
157
|
-
total_vote: Optional[int] = None
|
|
158
|
-
show_total_votes: Optional[bool] = None
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
@dataclass
|
|
162
|
-
class Poll(DataManager):
|
|
163
|
-
question: Optional[str] = None
|
|
164
|
-
options: Optional[list[str]] = None
|
|
165
|
-
poll_status: Optional[PollStatus] = None
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
@dataclass
|
|
169
|
-
class Location(DataManager):
|
|
170
|
-
longitude: Optional[str] = None
|
|
171
|
-
latitude: Optional[str] = None
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
@dataclass
|
|
175
|
-
class LiveLocation(DataManager):
|
|
176
|
-
start_time: Optional[str] = None
|
|
177
|
-
live_period: Optional[int] = None
|
|
178
|
-
current_location: Optional[Location] = None
|
|
179
|
-
user_id: Optional[str] = None
|
|
180
|
-
status: Optional[enums.LiveLocationStatus] = None
|
|
181
|
-
last_update_time: Optional[str] = None
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
@dataclass
|
|
185
|
-
class ButtonSelectionItem(DataManager):
|
|
186
|
-
text: Optional[str] = None
|
|
187
|
-
image_url: Optional[str] = None
|
|
188
|
-
type: Optional[enums.ButtonSelectionType] = None
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
@dataclass
|
|
192
|
-
class ButtonSelection(DataManager):
|
|
193
|
-
selection_id: Optional[str] = None
|
|
194
|
-
search_type: Optional[str] = None
|
|
195
|
-
get_type: Optional[str] = None
|
|
196
|
-
items: Optional[list[ButtonSelectionItem]] = None
|
|
197
|
-
is_multi_selection: Optional[bool] = None
|
|
198
|
-
columns_count: Optional[str] = None
|
|
199
|
-
title: Optional[str] = None
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
@dataclass
|
|
203
|
-
class ButtonCalendar(DataManager):
|
|
204
|
-
default_value: Optional[str] = None
|
|
205
|
-
type: Optional[enums.ButtonCalendarType] = None
|
|
206
|
-
min_year: Optional[str] = None
|
|
207
|
-
max_year: Optional[str] = None
|
|
208
|
-
title: Optional[str] = None
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
@dataclass
|
|
212
|
-
class ButtonNumberPicker(DataManager):
|
|
213
|
-
min_value: Optional[str] = None
|
|
214
|
-
max_value: Optional[str] = None
|
|
215
|
-
default_value: Optional[str] = None
|
|
216
|
-
title: Optional[str] = None
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
@dataclass
|
|
220
|
-
class ButtonStringPicker(DataManager):
|
|
221
|
-
items: Optional[list[str]] = None
|
|
222
|
-
default_value: Optional[str] = None
|
|
223
|
-
title: Optional[str] = None
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
@dataclass
|
|
227
|
-
class ButtonTextbox(DataManager):
|
|
228
|
-
type_line: Optional[enums.ButtonTextboxTypeLine] = None
|
|
229
|
-
type_keypad: Optional[enums.ButtonTextboxTypeKeypad] = None
|
|
230
|
-
place_holder: Optional[str] = None
|
|
231
|
-
title: Optional[str] = None
|
|
232
|
-
default_value: Optional[str] = None
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
@dataclass
|
|
236
|
-
class ButtonLocation(DataManager):
|
|
237
|
-
default_pointer_location: Optional[Location] = None
|
|
238
|
-
default_map_location: Optional[Location] = None
|
|
239
|
-
type: Optional[enums.ButtonLocationType] = None
|
|
240
|
-
title: Optional[str] = None
|
|
241
|
-
location_image_url: Optional[str] = None
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
@dataclass
|
|
245
|
-
class OpenChatData(DataManager):
|
|
246
|
-
object_guid: Optional[str] = None
|
|
247
|
-
object_type: Optional[enums.ChatType] = None
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
@dataclass
|
|
251
|
-
class JoinChannelData(DataManager):
|
|
252
|
-
username: Optional[str] = None
|
|
253
|
-
ask_join: bool = False
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
@dataclass
|
|
257
|
-
class ButtonLink(DataManager):
|
|
258
|
-
type: Optional[enums.ButtonLinkType] = None
|
|
259
|
-
link_url: Optional[str] = None
|
|
260
|
-
joinchannel_data: Optional[JoinChannelData] = None
|
|
261
|
-
open_chat_data: Optional[OpenChatData] = None
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
@dataclass
|
|
265
|
-
class AuxData(DataManager):
|
|
266
|
-
start_id: Optional[str] = None
|
|
267
|
-
button_id: Optional[str] = None
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
@dataclass
|
|
271
|
-
class Button(DataManager):
|
|
272
|
-
id: Optional[str] = None
|
|
273
|
-
button_text: Optional[str] = None
|
|
274
|
-
type: enums.ButtonType = enums.ButtonType.Simple
|
|
275
|
-
button_selection: Optional[ButtonSelection] = None
|
|
276
|
-
button_calendar: Optional[ButtonCalendar] = None
|
|
277
|
-
button_number_picker: Optional[ButtonNumberPicker] = None
|
|
278
|
-
button_string_picker: Optional[ButtonStringPicker] = None
|
|
279
|
-
button_location: Optional[ButtonLocation] = None
|
|
280
|
-
button_textbox: Optional[ButtonTextbox] = None
|
|
281
|
-
button_link: Optional[ButtonLink] = None
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
@dataclass
|
|
285
|
-
class KeypadRow(DataManager):
|
|
286
|
-
buttons: list[Button]
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
@dataclass
|
|
290
|
-
class Keypad(DataManager):
|
|
291
|
-
rows: list[KeypadRow]
|
|
292
|
-
resize_keyboard: bool = True
|
|
293
|
-
on_time_keyboard: bool = False
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
@dataclass
|
|
297
|
-
class MessageKeypadUpdate(DataManager):
|
|
298
|
-
message_id: Optional[str] = None
|
|
299
|
-
inline_keypad: Optional[Keypad] = None
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
@dataclass
|
|
303
|
-
class Message(DataManager):
|
|
304
|
-
message_id: Optional[str] = None
|
|
305
|
-
text: Optional[str] = None
|
|
306
|
-
time: Optional[str] = None
|
|
307
|
-
is_edited: Optional[bool] = None
|
|
308
|
-
sender_type: Optional[enums.MessageSender] = None
|
|
309
|
-
sender_id: Optional[str] = None
|
|
310
|
-
aux_data: Optional[AuxData] = None
|
|
311
|
-
file: Optional[File] = None
|
|
312
|
-
reply_to_message_id: Optional[str] = None
|
|
313
|
-
forwarded_from: Optional[ForwardedFrom] = None
|
|
314
|
-
forwarded_no_link: Optional[str] = None
|
|
315
|
-
location: Optional[Location] = None
|
|
316
|
-
sticker: Optional[Sticker] = None
|
|
317
|
-
contact_message: Optional[ContactMessage] = None
|
|
318
|
-
poll: Optional[Poll] = None
|
|
319
|
-
live_location: Optional[LiveLocation] = None
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
@dataclass
|
|
323
|
-
class MessageId(DataManager):
|
|
324
|
-
message_id: Optional[str] = None
|
|
325
|
-
file_id: Optional[str] = None
|
|
326
|
-
chat_id: Optional[str] = None
|
|
327
|
-
client: Optional["rubigram.Client"] = None
|
|
328
|
-
|
|
329
|
-
async def delete(self):
|
|
330
|
-
return await self.client.delete_message(self.chat_id, self.message_id)
|
|
331
|
-
|
|
332
|
-
async def edit(self, text: Optional[str] = None, inline: Optional[Keypad] = None, keypad: Optional[Keypad] = None):
|
|
333
|
-
if text:
|
|
334
|
-
await self.edit_text(text)
|
|
335
|
-
if inline:
|
|
336
|
-
await self.edit_inline(inline)
|
|
337
|
-
if keypad:
|
|
338
|
-
await self.edit_keypad(keypad)
|
|
339
|
-
|
|
340
|
-
async def edit_text(self, text: str):
|
|
341
|
-
return await self.client.edit_message_text(self.chat_id, self.message_id, text)
|
|
342
|
-
|
|
343
|
-
async def edit_inline(self, inline: Keypad):
|
|
344
|
-
return await self.client.edit_message_keypad(self.chat_id, self.message_id, inline)
|
|
345
|
-
|
|
346
|
-
async def edit_keypad(self, keypad: Keypad):
|
|
347
|
-
return await self.client.edit_chat_keypad(self.chat_id, keypad)
|
|
348
|
-
|
|
349
|
-
async def forward(self, chat_id: str):
|
|
350
|
-
return await self.client.forward_message(self.chat_id, self.message_id, chat_id)
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
@dataclass
|
|
354
|
-
class Update(DataManager):
|
|
355
|
-
type: Optional[enums.UpdateType] = None
|
|
356
|
-
chat_id: Optional[str] = None
|
|
357
|
-
removed_message_id: Optional[str] = None
|
|
358
|
-
new_message: Optional[Message] = None
|
|
359
|
-
updated_message: Optional[Message] = None
|
|
360
|
-
updated_payment: Optional[PaymentStatus] = None
|
|
361
|
-
client: Optional["rubigram.Client"] = None
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
async def download(self, file_name: str):
|
|
365
|
-
return await self.client.download_file(self.new_message.file.file_id, file_name)
|
|
366
|
-
|
|
367
|
-
async def forward(self, chat_id: str):
|
|
368
|
-
return await self.client.forward_message(self.chat_id, self.new_message.message_id, chat_id)
|
|
369
|
-
|
|
370
|
-
async def reply(
|
|
371
|
-
self,
|
|
372
|
-
text: str,
|
|
373
|
-
chat_keypad: Keypad = None,
|
|
374
|
-
inline_keypad: Keypad = None,
|
|
375
|
-
chat_keypad_type: Optional[enums.ChatKeypadType] = None,
|
|
376
|
-
disable_notification: bool = None,
|
|
377
|
-
) -> "MessageId":
|
|
378
|
-
return await self.client.send_message(
|
|
379
|
-
self.chat_id,
|
|
380
|
-
text,
|
|
381
|
-
chat_keypad,
|
|
382
|
-
inline_keypad,
|
|
383
|
-
chat_keypad_type,
|
|
384
|
-
disable_notification,
|
|
385
|
-
self.new_message.message_id,
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
async def reply_poll(
|
|
389
|
-
self,
|
|
390
|
-
question: str,
|
|
391
|
-
options: list[str],
|
|
392
|
-
chat_keypad: Keypad = None,
|
|
393
|
-
inline_keypad: Keypad = None,
|
|
394
|
-
chat_keypad_type: Optional[enums.ChatKeypadType] = None,
|
|
395
|
-
disable_notification: bool = False,
|
|
396
|
-
) -> "MessageId":
|
|
397
|
-
return await self.client.send_poll(
|
|
398
|
-
self.chat_id,
|
|
399
|
-
question,
|
|
400
|
-
options,
|
|
401
|
-
chat_keypad,
|
|
402
|
-
inline_keypad,
|
|
403
|
-
chat_keypad_type,
|
|
404
|
-
disable_notification,
|
|
405
|
-
self.new_message.message_id,
|
|
406
|
-
)
|
|
407
|
-
|
|
408
|
-
async def reply_location(
|
|
409
|
-
self,
|
|
410
|
-
latitude: str,
|
|
411
|
-
longitude: str,
|
|
412
|
-
chat_keypad: Keypad = None,
|
|
413
|
-
inline_keypad: Keypad = None,
|
|
414
|
-
chat_keypad_type: Optional[enums.ChatKeypadType] = None,
|
|
415
|
-
disable_notification: bool = False,
|
|
416
|
-
) -> "MessageId":
|
|
417
|
-
return await self.client.send_location(
|
|
418
|
-
self.chat_id,
|
|
419
|
-
latitude,
|
|
420
|
-
longitude,
|
|
421
|
-
chat_keypad,
|
|
422
|
-
inline_keypad,
|
|
423
|
-
chat_keypad_type,
|
|
424
|
-
disable_notification,
|
|
425
|
-
self.new_message.message_id,
|
|
426
|
-
)
|
|
427
|
-
|
|
428
|
-
async def reply_contact(
|
|
429
|
-
self,
|
|
430
|
-
first_name: str,
|
|
431
|
-
last_name: str,
|
|
432
|
-
phone_number: str,
|
|
433
|
-
chat_keypad: Keypad = None,
|
|
434
|
-
inline_keypad: Keypad = None,
|
|
435
|
-
chat_keypad_type: Optional[enums.ChatKeypadType] = None,
|
|
436
|
-
disable_notification: bool = False,
|
|
437
|
-
) -> "MessageId":
|
|
438
|
-
return await self.client.send_location(
|
|
439
|
-
self.chat_id,
|
|
440
|
-
first_name,
|
|
441
|
-
last_name,
|
|
442
|
-
phone_number,
|
|
443
|
-
chat_keypad,
|
|
444
|
-
inline_keypad,
|
|
445
|
-
chat_keypad_type,
|
|
446
|
-
disable_notification,
|
|
447
|
-
self.new_message.message_id,
|
|
448
|
-
)
|
|
449
|
-
|
|
450
|
-
async def reply_sticker(
|
|
451
|
-
self,
|
|
452
|
-
sticker_id: str,
|
|
453
|
-
chat_keypad: Keypad = None,
|
|
454
|
-
inline_keypad: Keypad = None,
|
|
455
|
-
chat_keypad_type: Optional[enums.ChatKeypadType] = None,
|
|
456
|
-
disable_notification: bool = False,
|
|
457
|
-
) -> "MessageId":
|
|
458
|
-
return await self.client.send_message(
|
|
459
|
-
self.chat_id,
|
|
460
|
-
sticker_id,
|
|
461
|
-
chat_keypad,
|
|
462
|
-
inline_keypad,
|
|
463
|
-
chat_keypad_type,
|
|
464
|
-
disable_notification,
|
|
465
|
-
self.new_message.message_id,
|
|
466
|
-
)
|
|
467
|
-
|
|
468
|
-
async def reply_file(
|
|
469
|
-
self,
|
|
470
|
-
file: Union[str, bytes],
|
|
471
|
-
caption: Optional[str] = None,
|
|
472
|
-
file_name: Optional[str] = None,
|
|
473
|
-
type: enums.FileType = enums.FileType.File,
|
|
474
|
-
chat_keypad: Keypad = None,
|
|
475
|
-
inline_keypad: Keypad = None,
|
|
476
|
-
chat_keypad_type: Optional[enums.ChatKeypadType] = None,
|
|
477
|
-
disable_notification: bool = False,
|
|
478
|
-
) -> "MessageId":
|
|
479
|
-
return await self.client.send_file(
|
|
480
|
-
self.chat_id,
|
|
481
|
-
file,
|
|
482
|
-
caption,
|
|
483
|
-
file_name,
|
|
484
|
-
type,
|
|
485
|
-
chat_keypad,
|
|
486
|
-
inline_keypad,
|
|
487
|
-
chat_keypad_type,
|
|
488
|
-
disable_notification,
|
|
489
|
-
self.new_message.message_id,
|
|
490
|
-
)
|
|
491
|
-
|
|
492
|
-
async def reply_document(self, document: Union[str, bytes], caption: Optional[str] = None, file_name: Optional[str] = None, **kwargs) -> "MessageId":
|
|
493
|
-
return await self.reply_file(document, caption, file_name, "File", **kwargs)
|
|
494
|
-
|
|
495
|
-
async def reply_photo(self, photo: Union[str, bytes], caption: Optional[str] = None, file_name: Optional[str] = None, **kwargs) -> "MessageId":
|
|
496
|
-
return await self.reply_file(photo, caption, file_name, "Image", **kwargs)
|
|
497
|
-
|
|
498
|
-
async def reply_video(self, video: Union[str, bytes], caption: Optional[str] = None, file_name: Optional[str] = None, **kwargs) -> "MessageId":
|
|
499
|
-
return await self.reply_file(video, caption, file_name, "Video", **kwargs)
|
|
500
|
-
|
|
501
|
-
async def reply_gif(self, gif: Union[str, bytes], caption: Optional[str] = None, file_name: Optional[str] = None, **kwargs) -> "MessageId":
|
|
502
|
-
return await self.reply_file(gif, caption, file_name, "Gif", **kwargs)
|
|
503
|
-
|
|
504
|
-
async def reply_music(self, music: Union[str, bytes], caption: Optional[str] = None, file_name: Optional[str] = None, **kwargs) -> "MessageId":
|
|
505
|
-
return await self.reply_file(music, caption, file_name, "Music", **kwargs)
|
|
506
|
-
|
|
507
|
-
async def reply_voice(self, voice: Union[str, bytes], caption: Optional[str] = None, file_name: Optional[str] = None, **kwargs) -> "MessageId":
|
|
508
|
-
return await self.reply_file(voice, caption, file_name, "Voice", **kwargs)
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
@dataclass
|
|
512
|
-
class InlineMessage(DataManager):
|
|
513
|
-
sender_id: Optional[str] = None
|
|
514
|
-
text: Optional[str] = None
|
|
515
|
-
message_id: Optional[str] = None
|
|
516
|
-
chat_id: Optional[str] = None
|
|
517
|
-
file: Optional[File] = None
|
|
518
|
-
location: Optional[Location] = None
|
|
519
|
-
aux_data: Optional[AuxData] = None
|
|
520
|
-
client: Optional["rubigram.Client"] = None
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
@dataclass
|
|
524
|
-
class Updates(DataManager):
|
|
525
|
-
updates: Optional[list[Update]] = None
|
|
526
|
-
next_offset_id: Optional[str] = None
|
|
527
|
-
|
|
528
|
-
@classmethod
|
|
529
|
-
def from_dict(cls, data: dict):
|
|
530
|
-
data = data or {}
|
|
531
|
-
updates_list = data.get("updates") or []
|
|
532
|
-
updates_objects = [
|
|
533
|
-
Update.from_dict(update) if isinstance(update, dict) else update for update in updates_list
|
|
534
|
-
]
|
|
535
|
-
return cls(
|
|
536
|
-
updates=updates_objects,
|
|
537
|
-
next_offset_id=data.get("next_offset_id")
|
|
538
|
-
)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
rubigram/__init__.py,sha256=yyPILotyVazCcf1qrKEu_67yYsvLGns2oJlSfLmvhd8,152
|
|
2
|
-
rubigram/client.py,sha256=XKP6b_JS7XlPYtqDndh5ZxaaxMis8icPmu9Wyk6JNLQ,7334
|
|
3
|
-
rubigram/enums.py,sha256=maI0tD9hQz6QUbjiAmBzMowfZbj1ao-6LqkYybSpbFY,2841
|
|
4
|
-
rubigram/filters.py,sha256=5NjyYLeSkDqGLGjQ_FsEgvaXqy6ZC73PEL3-_ei6B0g,6987
|
|
5
|
-
rubigram/method.py,sha256=auj9LOjDEK5mumndctHMbMMvjRvslusLNnJjmV-uPmo,14311
|
|
6
|
-
rubigram/network.py,sha256=Z976w5iV9IH7WV2DsIwe9pJU0yAwHhwIxFWTZRiDHbY,2858
|
|
7
|
-
rubigram/state.py,sha256=_g13o87MHfuudbgvbfu9vAOrSzw4GhdEYkD6dSn7t2s,997
|
|
8
|
-
rubigram/types.py,sha256=mMABq921FiWfOeurSJgtdkyIbz31bNE7ru14C9GyYSk,17195
|
|
9
|
-
rubigram/rubino/__init__.py,sha256=6-ztB6rLeIB3SV4tbVPPUxmNqHQUYQhDee6bnNQdECw,26
|
|
10
|
-
rubigram/rubino/client.py,sha256=nIYkADXe85BGK7N3qI3FB4fiMX1KuLfXtDATO8czhzc,18387
|
|
11
|
-
rubigramclient-1.7.1.dist-info/licenses/LICENSE,sha256=W2bekuLJMG2c-8SvTkJflMF5wY_Mx6rsXfXoCQvRzOI,1081
|
|
12
|
-
rubigramclient-1.7.1.dist-info/METADATA,sha256=A4OFG5w9NwzAn44SHxqsaCBw8IA1RnFRAedY7nTIPYk,4492
|
|
13
|
-
rubigramclient-1.7.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
-
rubigramclient-1.7.1.dist-info/top_level.txt,sha256=Mhg5HfkL6rLec5sI4ClGmwoqYUANAZUz8sVa1sT_cas,9
|
|
15
|
-
rubigramclient-1.7.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|