RubigramClient 1.7.1__py3-none-any.whl → 1.7.3__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.

Files changed (74) hide show
  1. rubigram/__init__.py +1 -5
  2. rubigram/client.py +102 -154
  3. rubigram/enums.py +4 -3
  4. rubigram/filters.py +600 -139
  5. rubigram/handler.py +24 -0
  6. rubigram/http.py +32 -0
  7. rubigram/logger.py +20 -0
  8. rubigram/method/__init__.py +18 -0
  9. rubigram/method/chat/__init__.py +10 -0
  10. rubigram/method/chat/get_chat.py +26 -0
  11. rubigram/method/chat/get_me.py +22 -0
  12. rubigram/method/chat/get_update.py +32 -0
  13. rubigram/method/decorator/__init__.py +19 -0
  14. rubigram/method/decorator/on_delete_message.py +37 -0
  15. rubigram/method/decorator/on_edit_message.py +37 -0
  16. rubigram/method/decorator/on_inline_message.py +40 -0
  17. rubigram/method/decorator/on_message.py +38 -0
  18. rubigram/method/decorator/on_start.py +30 -0
  19. rubigram/method/decorator/on_stop.py +29 -0
  20. rubigram/method/decorator/register.py +43 -0
  21. rubigram/method/file/__init__.py +32 -0
  22. rubigram/method/file/download_file.py +34 -0
  23. rubigram/method/file/get_bytes.py +25 -0
  24. rubigram/method/file/get_file.py +27 -0
  25. rubigram/method/file/get_file_name.py +29 -0
  26. rubigram/method/file/request_download_file.py +35 -0
  27. rubigram/method/file/request_send_file.py +28 -0
  28. rubigram/method/file/request_upload_file.py +62 -0
  29. rubigram/method/file/send_document.py +58 -0
  30. rubigram/method/file/send_file.py +78 -0
  31. rubigram/method/file/send_gif.py +58 -0
  32. rubigram/method/file/send_music.py +58 -0
  33. rubigram/method/file/send_photo.py +58 -0
  34. rubigram/method/file/send_video.py +58 -0
  35. rubigram/method/file/send_voice.py +55 -0
  36. rubigram/method/messages/__init__.py +29 -0
  37. rubigram/method/messages/delete_message.py +50 -0
  38. rubigram/method/messages/edit_chat_keypad.py +34 -0
  39. rubigram/method/messages/edit_message.py +41 -0
  40. rubigram/method/messages/edit_message_keypad.py +38 -0
  41. rubigram/method/messages/edit_message_text.py +34 -0
  42. rubigram/method/messages/forward_message.py +43 -0
  43. rubigram/method/messages/remove_chat_keypad.py +28 -0
  44. rubigram/method/messages/send_contact.py +74 -0
  45. rubigram/method/messages/send_location.py +70 -0
  46. rubigram/method/messages/send_message.py +67 -0
  47. rubigram/method/messages/send_poll.py +71 -0
  48. rubigram/method/messages/send_sticker.py +66 -0
  49. rubigram/method/network/__init__.py +7 -0
  50. rubigram/method/network/request.py +20 -0
  51. rubigram/method/setting/__init__.py +9 -0
  52. rubigram/method/setting/set_command.py +32 -0
  53. rubigram/method/setting/update_bot_endpoint.py +31 -0
  54. rubigram/method/utilities/__init__.py +11 -0
  55. rubigram/method/utilities/dispatch.py +25 -0
  56. rubigram/method/utilities/setup_endpoint.py +16 -0
  57. rubigram/method/utilities/updater.py +17 -0
  58. rubigram/rubino/client.py +16 -130
  59. rubigram/rubino/network.py +121 -0
  60. rubigram/state.py +14 -19
  61. rubigram/types/__init__.py +3 -0
  62. rubigram/types/messages.py +175 -0
  63. rubigram/types/object.py +112 -0
  64. rubigram/types/types.py +211 -0
  65. rubigram/types/updates.py +572 -0
  66. {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.3.dist-info}/METADATA +4 -3
  67. rubigramclient-1.7.3.dist-info/RECORD +71 -0
  68. rubigram/method.py +0 -354
  69. rubigram/network.py +0 -80
  70. rubigram/types.py +0 -538
  71. rubigramclient-1.7.1.dist-info/RECORD +0 -15
  72. {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.3.dist-info}/WHEEL +0 -0
  73. {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.3.dist-info}/licenses/LICENSE +0 -0
  74. {rubigramclient-1.7.1.dist-info → rubigramclient-1.7.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,572 @@
1
+ from typing import Optional
2
+ from dataclasses import dataclass
3
+ from .object import Object
4
+ from .types import *
5
+ import rubigram
6
+
7
+
8
+ @dataclass
9
+ class Update(Object):
10
+ type: Optional[enums.UpdateType] = None
11
+ chat_id: Optional[str] = None
12
+ removed_message_id: Optional[str] = None
13
+ new_message: Optional["rubigram.types.Message"] = None
14
+ updated_message: Optional["rubigram.types.Message"] = None
15
+ updated_payment: Optional["rubigram.types.PaymentStatus"] = None
16
+ client: Optional["rubigram.Client"] = None
17
+
18
+ async def reply(
19
+ self,
20
+ text: str,
21
+ chat_keypad: Optional[Keypad] = None,
22
+ inline_keypad: Optional[Keypad] = None,
23
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
24
+ disable_notification: Optional[bool] = None,
25
+ ) -> "rubigram.types.UMessage":
26
+ """Reply to the current message with text and optional keypads.
27
+
28
+ Args:
29
+ text (str): The text of the reply message.
30
+ chat_keypad (Optional[Keypad], optional): Keypad to show in the chat. Defaults to None.
31
+ inline_keypad (Optional[Keypad], optional): Inline keypad to show. Defaults to None.
32
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad. Defaults to None.
33
+ disable_notification (Optional[bool], optional): If True, disables notification for the message. Defaults to None.
34
+
35
+ Returns:
36
+ rubigram.types.UMessage: The sent reply message object.
37
+
38
+ Example:
39
+ >>> reply_msg = await update.reply("Hello!", chat_keypad=my_keypad)
40
+ """
41
+ return await self.client.send_message(
42
+ self.chat_id,
43
+ text,
44
+ chat_keypad,
45
+ inline_keypad,
46
+ chat_keypad_type,
47
+ disable_notification,
48
+ self.new_message.message_id if self.new_message else None,
49
+ )
50
+
51
+ async def reply_poll(
52
+ self,
53
+ question: str,
54
+ options: list[str],
55
+ chat_keypad: Optional[Keypad] = None,
56
+ inline_keypad: Optional[Keypad] = None,
57
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
58
+ disable_notification: bool = False,
59
+ ) -> "rubigram.types.UMessage":
60
+ """Reply to the current message with a poll.
61
+
62
+ Args:
63
+ question (str): The poll question text.
64
+ options (list[str]): A list of options for the poll.
65
+ chat_keypad (Optional[Keypad], optional): Keypad to show in the chat. Defaults to None.
66
+ inline_keypad (Optional[Keypad], optional): Inline keypad to show. Defaults to None.
67
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad. Defaults to None.
68
+ disable_notification (bool, optional): If True, disables notification for the message. Defaults to False.
69
+
70
+ Returns:
71
+ rubigram.types.UMessage: The sent poll message object.
72
+
73
+ Example:
74
+ >>> poll_msg = await update.reply_poll(
75
+ >>> "What's your favorite color?",
76
+ >>> ["Red", "Blue", "Green"]
77
+ >>> )
78
+ """
79
+ return await self.client.send_poll(
80
+ self.chat_id,
81
+ question,
82
+ options,
83
+ chat_keypad,
84
+ inline_keypad,
85
+ chat_keypad_type,
86
+ disable_notification,
87
+ self.new_message.message_id if self.new_message else None,
88
+ )
89
+
90
+ async def reply_location(
91
+ self,
92
+ latitude: str,
93
+ longitude: str,
94
+ chat_keypad: Optional[Keypad] = None,
95
+ inline_keypad: Optional[Keypad] = None,
96
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
97
+ disable_notification: bool = False,
98
+ ) -> "rubigram.types.UMessage":
99
+ """Reply to the current message with a location.
100
+
101
+ Args:
102
+ latitude (str): Latitude of the location.
103
+ longitude (str): Longitude of the location.
104
+ chat_keypad (Optional[Keypad], optional): Keypad to show in chat. Defaults to None.
105
+ inline_keypad (Optional[Keypad], optional): Inline keypad to show. Defaults to None.
106
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad. Defaults to None.
107
+ disable_notification (bool, optional): If True, disables notification. Defaults to False.
108
+
109
+ Returns:
110
+ rubigram.types.UMessage: The sent location message.
111
+
112
+ Example:
113
+ >>> await update.reply_location("35.6895", "139.6917")
114
+ """
115
+ return await self.client.send_location(
116
+ self.chat_id,
117
+ latitude,
118
+ longitude,
119
+ chat_keypad,
120
+ inline_keypad,
121
+ chat_keypad_type,
122
+ disable_notification,
123
+ self.new_message.message_id if self.new_message else None,
124
+ )
125
+
126
+ async def reply_contact(
127
+ self,
128
+ first_name: str,
129
+ last_name: str,
130
+ phone_number: str,
131
+ chat_keypad: Optional[Keypad] = None,
132
+ inline_keypad: Optional[Keypad] = None,
133
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
134
+ disable_notification: bool = False,
135
+ ) -> "rubigram.types.UMessage":
136
+ """Reply to the current message with a contact.
137
+
138
+ Args:
139
+ first_name (str): Contact's first name.
140
+ last_name (str): Contact's last name.
141
+ phone_number (str): Contact's phone number.
142
+ chat_keypad (Optional[Keypad], optional): Keypad to show in chat. Defaults to None.
143
+ inline_keypad (Optional[Keypad], optional): Inline keypad to show. Defaults to None.
144
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad. Defaults to None.
145
+ disable_notification (bool, optional): If True, disables notification. Defaults to False.
146
+
147
+ Returns:
148
+ rubigram.types.UMessage: The sent contact message.
149
+
150
+ Example:
151
+ >>> await update.reply_contact("John", "Doe", "+123456789")
152
+ """
153
+ return await self.client.send_contact(
154
+ self.chat_id,
155
+ first_name,
156
+ last_name,
157
+ phone_number,
158
+ chat_keypad,
159
+ inline_keypad,
160
+ chat_keypad_type,
161
+ disable_notification,
162
+ self.new_message.message_id if self.new_message else None,
163
+ )
164
+
165
+ async def reply_sticker(
166
+ self,
167
+ sticker_id: str,
168
+ chat_keypad: Optional[Keypad] = None,
169
+ inline_keypad: Optional[Keypad] = None,
170
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
171
+ disable_notification: bool = False,
172
+ ) -> "rubigram.types.UMessage":
173
+ """Reply to the current message with a sticker.
174
+
175
+ Args:
176
+ sticker_id (str): The ID of the sticker to send.
177
+ chat_keypad (Optional[Keypad], optional): Keypad to show in chat. Defaults to None.
178
+ inline_keypad (Optional[Keypad], optional): Inline keypad to show. Defaults to None.
179
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad. Defaults to None.
180
+ disable_notification (bool, optional): If True, disables notification. Defaults to False.
181
+
182
+ Returns:
183
+ rubigram.types.UMessage: The sent sticker message.
184
+
185
+ Example:
186
+ >>> await update.reply_sticker("CAADAgADQAADyIsGAAE7MpzFPFQXkQI")
187
+ """
188
+ return await self.client.send_message(
189
+ self.chat_id,
190
+ sticker_id,
191
+ chat_keypad,
192
+ inline_keypad,
193
+ chat_keypad_type,
194
+ disable_notification,
195
+ self.new_message.message_id if self.new_message else None,
196
+ )
197
+
198
+ async def reply_file(
199
+ self,
200
+ file: Union[str, bytes],
201
+ caption: Optional[str] = None,
202
+ file_name: Optional[str] = None,
203
+ type: Optional[Union[str, enums.FileType]] = enums.FileType.File,
204
+ chat_keypad: Optional[Keypad] = None,
205
+ inline_keypad: Optional[Keypad] = None,
206
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
207
+ disable_notification: bool = False,
208
+ ) -> "rubigram.types.UMessage":
209
+ """Reply to the current message with a file.
210
+
211
+ Args:
212
+ file (Union[str, bytes]): The file path or binary data to send.
213
+ caption (Optional[str], optional): Caption for the file. Defaults to None.
214
+ file_name (Optional[str], optional): Custom filename for the file. Defaults to None.
215
+ type (enums.FileType, optional): Type of the file (File, Document, etc.). Defaults to File.
216
+ chat_keypad (Optional[Keypad], optional): Keypad to show in chat. Defaults to None.
217
+ inline_keypad (Optional[Keypad], optional): Inline keypad to show. Defaults to None.
218
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad. Defaults to None.
219
+ disable_notification (bool, optional): If True, disables notification. Defaults to False.
220
+
221
+ Returns:
222
+ rubigram.types.UMessage: The sent file message.
223
+
224
+ Example:
225
+ >>> await update.reply_file("example.pdf", caption="Here is your file")
226
+ """
227
+ return await self.client.send_file(
228
+ self.chat_id,
229
+ file,
230
+ caption,
231
+ file_name,
232
+ type,
233
+ chat_keypad,
234
+ inline_keypad,
235
+ chat_keypad_type,
236
+ disable_notification,
237
+ self.new_message.message_id if self.new_message else None,
238
+ )
239
+
240
+ async def reply_document(
241
+ self,
242
+ document: Union[str, bytes],
243
+ caption: Optional[str] = None,
244
+ file_name: Optional[str] = None,
245
+ chat_keypad: Optional[Keypad] = None,
246
+ inline_keypad: Optional[Keypad] = None,
247
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
248
+ disable_notification: bool = False,
249
+ ) -> "rubigram.types.UMessage":
250
+ """Reply to the current message with a document file.
251
+
252
+ This method sends a document as a reply to the current message, optionally with a caption,
253
+ custom file name, chat or inline keypads, chat keypad type, and notification control.
254
+
255
+ Args:
256
+ document (Union[str, bytes]): The path or bytes of the document to send.
257
+ caption (Optional[str], optional): Text caption for the document. Defaults to None.
258
+ file_name (Optional[str], optional): Custom name for the file. Defaults to None.
259
+ type (Optional[Union[str, enums.FileType]], optional): The type of the file. Defaults to enums.FileType.Document.
260
+ chat_keypad (Optional[Keypad], optional): Keypad to attach to the chat. Defaults to None.
261
+ inline_keypad (Optional[Keypad], optional): Keypad to attach inline. Defaults to None.
262
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad if applicable. Defaults to None.
263
+ disable_notification (bool, optional): If True, disables notification for this message. Defaults to False.
264
+
265
+ Returns:
266
+ rubigram.types.UMessage: The sent reply message object.
267
+
268
+ Example:
269
+ >>> await update.reply_document(
270
+ >>> document="example.pdf",
271
+ >>> caption="Here is the file",
272
+ >>> chat_keypad=keypad
273
+ >>> )
274
+ """
275
+ return await self.reply_file(
276
+ document,
277
+ caption,
278
+ file_name,
279
+ "File",
280
+ chat_keypad,
281
+ inline_keypad,
282
+ chat_keypad_type,
283
+ disable_notification
284
+ )
285
+
286
+ async def reply_photo(
287
+ self,
288
+ photo: Union[str, bytes],
289
+ caption: Optional[str] = None,
290
+ file_name: Optional[str] = None,
291
+ chat_keypad: Optional[Keypad] = None,
292
+ inline_keypad: Optional[Keypad] = None,
293
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
294
+ disable_notification: bool = False,
295
+ ) -> "rubigram.types.UMessage":
296
+ """Reply to the current message with a photo.
297
+
298
+ This method sends a photo as a reply to the current message, optionally with a caption,
299
+ custom file name, chat or inline keypads, chat keypad type, and notification control.
300
+
301
+ Args:
302
+ photo (Union[str, bytes]): The path or bytes of the photo to send.
303
+ caption (Optional[str], optional): Text caption for the photo. Defaults to None.
304
+ file_name (Optional[str], optional): Custom name for the file. Defaults to None.
305
+ chat_keypad (Optional[Keypad], optional): Keypad to attach to the chat. Defaults to None.
306
+ inline_keypad (Optional[Keypad], optional): Keypad to attach inline. Defaults to None.
307
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad if applicable. Defaults to None.
308
+ disable_notification (bool, optional): If True, disables notification for this message. Defaults to False.
309
+
310
+ Returns:
311
+ rubigram.types.UMessage: The sent reply message object.
312
+
313
+ Example:
314
+ >>> await update.reply_photo(
315
+ >>> photo="example.jpg",
316
+ >>> caption="Here is the photo",
317
+ >>> chat_keypad=keypad
318
+ >>> )
319
+ """
320
+ return await self.reply_file(
321
+ photo,
322
+ caption,
323
+ file_name,
324
+ "Image",
325
+ chat_keypad,
326
+ inline_keypad,
327
+ chat_keypad_type,
328
+ disable_notification
329
+ )
330
+
331
+ async def reply_video(
332
+ self,
333
+ video: Union[str, bytes],
334
+ caption: Optional[str] = None,
335
+ file_name: Optional[str] = None,
336
+ chat_keypad: Optional[Keypad] = None,
337
+ inline_keypad: Optional[Keypad] = None,
338
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
339
+ disable_notification: bool = False,
340
+ ) -> "rubigram.types.UMessage":
341
+ """Reply to the current message with a video file.
342
+
343
+ This method sends a video as a reply to the current message, optionally with a caption,
344
+ custom file name, chat or inline keypads, chat keypad type, and notification control.
345
+
346
+ Args:
347
+ video (Union[str, bytes]): The path or bytes of the video to send.
348
+ caption (Optional[str], optional): Text caption for the video. Defaults to None.
349
+ file_name (Optional[str], optional): Custom name for the file. Defaults to None.
350
+ chat_keypad (Optional[Keypad], optional): Keypad to attach to the chat. Defaults to None.
351
+ inline_keypad (Optional[Keypad], optional): Keypad to attach inline. Defaults to None.
352
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad if applicable. Defaults to None.
353
+ disable_notification (bool, optional): If True, disables notification for this message. Defaults to False.
354
+
355
+ Returns:
356
+ rubigram.types.UMessage: The sent reply message object.
357
+
358
+ Example:
359
+ >>> await update.reply_video(
360
+ >>> video="example.mp4",
361
+ >>> caption="Here is the video",
362
+ >>> chat_keypad=keypad
363
+ >>> )
364
+ """
365
+ return await self.reply_file(
366
+ video,
367
+ caption,
368
+ file_name,
369
+ "Video",
370
+ chat_keypad,
371
+ inline_keypad,
372
+ chat_keypad_type,
373
+ disable_notification
374
+ )
375
+
376
+ async def reply_gif(
377
+ self,
378
+ gif: Union[str, bytes],
379
+ caption: Optional[str] = None,
380
+ file_name: Optional[str] = None,
381
+ chat_keypad: Optional[Keypad] = None,
382
+ inline_keypad: Optional[Keypad] = None,
383
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
384
+ disable_notification: bool = False,
385
+ ) -> "rubigram.types.UMessage":
386
+ """Reply to the current message with a GIF file.
387
+
388
+ This method sends a GIF as a reply to the current message, optionally with a caption,
389
+ custom file name, chat or inline keypads, chat keypad type, and notification control.
390
+
391
+ Args:
392
+ gif (Union[str, bytes]): The path or bytes of the GIF to send.
393
+ caption (Optional[str], optional): Text caption for the GIF. Defaults to None.
394
+ file_name (Optional[str], optional): Custom name for the file. Defaults to None.
395
+ chat_keypad (Optional[Keypad], optional): Keypad to attach to the chat. Defaults to None.
396
+ inline_keypad (Optional[Keypad], optional): Keypad to attach inline. Defaults to None.
397
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad if applicable. Defaults to None.
398
+ disable_notification (bool, optional): If True, disables notification for this message. Defaults to False.
399
+
400
+ Returns:
401
+ rubigram.types.UMessage: The sent reply message object.
402
+
403
+ Example:
404
+ >>> await update.reply_gif(
405
+ >>> gif="funny.gif",
406
+ >>> caption="Check out this GIF!",
407
+ >>> chat_keypad=keypad
408
+ >>> )
409
+ """
410
+ return await self.reply_file(
411
+ gif,
412
+ caption,
413
+ file_name,
414
+ "Gif",
415
+ chat_keypad,
416
+ inline_keypad,
417
+ chat_keypad_type,
418
+ disable_notification
419
+ )
420
+
421
+ async def reply_music(
422
+ self,
423
+ music: Union[str, bytes],
424
+ caption: Optional[str] = None,
425
+ file_name: Optional[str] = None,
426
+ chat_keypad: Optional[Keypad] = None,
427
+ inline_keypad: Optional[Keypad] = None,
428
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
429
+ disable_notification: bool = False,
430
+ ) -> "rubigram.types.UMessage":
431
+ """Reply to the current message with a music/audio file.
432
+
433
+ This method sends a music/audio file as a reply to the current message, optionally with a caption,
434
+ custom file name, chat or inline keypads, chat keypad type, and notification control.
435
+
436
+ Args:
437
+ music (Union[str, bytes]): The path or bytes of the music file to send.
438
+ caption (Optional[str], optional): Text caption for the music. Defaults to None.
439
+ file_name (Optional[str], optional): Custom name for the file. Defaults to None.
440
+ chat_keypad (Optional[Keypad], optional): Keypad to attach to the chat. Defaults to None.
441
+ inline_keypad (Optional[Keypad], optional): Keypad to attach inline. Defaults to None.
442
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad if applicable. Defaults to None.
443
+ disable_notification (bool, optional): If True, disables notification for this message. Defaults to False.
444
+
445
+ Returns:
446
+ rubigram.types.UMessage: The sent reply message object.
447
+
448
+ Example:
449
+ >>> await update.reply_music(
450
+ >>> music="song.mp3",
451
+ >>> caption="Listen to this!",
452
+ >>> chat_keypad=keypad
453
+ >>> )
454
+ """
455
+ return await self.reply_file(
456
+ music,
457
+ caption,
458
+ file_name,
459
+ "Music",
460
+ chat_keypad,
461
+ inline_keypad,
462
+ chat_keypad_type,
463
+ disable_notification
464
+ )
465
+
466
+ async def reply_voice(
467
+ self,
468
+ voice: Union[str, bytes],
469
+ caption: Optional[str] = None,
470
+ file_name: Optional[str] = None,
471
+ chat_keypad: Optional[Keypad] = None,
472
+ inline_keypad: Optional[Keypad] = None,
473
+ chat_keypad_type: Optional[enums.ChatKeypadType] = None,
474
+ disable_notification: bool = False,
475
+ ) -> "rubigram.types.UMessage":
476
+ """Reply to the current message with a voice note.
477
+
478
+ This method sends a voice message as a reply to the current message, optionally with a caption,
479
+ custom file name, chat or inline keypads, chat keypad type, and notification control.
480
+
481
+ Args:
482
+ voice (Union[str, bytes]): The path or bytes of the voice file to send.
483
+ caption (Optional[str], optional): Text caption for the voice message. Defaults to None.
484
+ file_name (Optional[str], optional): Custom name for the file. Defaults to None.
485
+ chat_keypad (Optional[Keypad], optional): Keypad to attach to the chat. Defaults to None.
486
+ inline_keypad (Optional[Keypad], optional): Keypad to attach inline. Defaults to None.
487
+ chat_keypad_type (Optional[enums.ChatKeypadType], optional): Type of chat keypad if applicable. Defaults to None.
488
+ disable_notification (bool, optional): If True, disables notification for this message. Defaults to False.
489
+
490
+ Returns:
491
+ rubigram.types.UMessage: The sent reply message object.
492
+
493
+ Example:
494
+ >>> await update.reply_voice(
495
+ >>> voice="voice.ogg",
496
+ >>> caption="Listen to this voice note!",
497
+ >>> chat_keypad=keypad
498
+ >>> )
499
+ """
500
+ return await self.reply_file(
501
+ voice,
502
+ caption,
503
+ file_name,
504
+ "Voice",
505
+ chat_keypad,
506
+ inline_keypad,
507
+ chat_keypad_type,
508
+ disable_notification
509
+ )
510
+
511
+ async def download(
512
+ self,
513
+ save_as: str
514
+ ) -> str:
515
+ """Download the file attached to the current message.
516
+
517
+ This method downloads the file associated with the message (if any)
518
+ and saves it locally with the specified file name.
519
+
520
+ Args:
521
+ file_name (str): The name (including path if needed) to save the downloaded file as.
522
+
523
+ Returns:
524
+ str: The path to the downloaded file.
525
+
526
+ Example:
527
+ >>> await update.download("my_file.pdf")
528
+ """
529
+ return await self.client.download_file(
530
+ self.new_message.file.file_id,
531
+ save_as
532
+ )
533
+
534
+ async def forward(
535
+ self,
536
+ chat_id: str
537
+ ) -> "rubigram.types.UMessage":
538
+ """Forward the current message to another chat.
539
+
540
+ This method forwards the message represented by this update to the specified chat ID.
541
+
542
+ Args:
543
+ chat_id (str): The target chat ID to forward the message to.
544
+
545
+ Returns:
546
+ rubigram.types.UMessage: The forwarded message object in the target chat.
547
+
548
+ Example:
549
+ >>> await update.forward("g0123456789")
550
+ """
551
+ return await self.client.forward_message(
552
+ self.chat_id,
553
+ self.new_message.message_id,
554
+ chat_id
555
+ )
556
+
557
+
558
+ @dataclass
559
+ class Updates(Object):
560
+ updates: Optional[list["rubigram.types.Update"]] = None
561
+ next_offset_id: Optional[str] = None
562
+
563
+ @classmethod
564
+ def parse(cls, data: dict):
565
+ data = data or {}
566
+ updates = [
567
+ rubigram.types.Update.parse(update) if isinstance(update, dict) else update for update in data.get("updates", []) or []
568
+ ]
569
+ return cls(
570
+ updates=updates,
571
+ next_offset_id=data.get("next_offset_id")
572
+ )
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RubigramClient
3
- Version: 1.7.1
3
+ Version: 1.7.3
4
4
  Summary: A simple and flexible Python library for building advanced Rubika bots with powerful message handling, inline buttons, and custom filters.
5
- Author-email: Javad RZ <MrJavad.Email@gmail.com>
5
+ Author-email: Javad <MrJavad.Email@gmail.com>
6
6
  License: MIT License
7
7
 
8
8
  Copyright (c) 2025 Javad
@@ -24,6 +24,7 @@ License: MIT License
24
24
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
25
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  SOFTWARE.
27
+ Project-URL: GitHub, https://github.com/Javad-RZ/rubigram
27
28
  Classifier: Programming Language :: Python :: 3
28
29
  Classifier: License :: OSI Approved :: MIT License
29
30
  Classifier: Operating System :: OS Independent
@@ -38,7 +39,7 @@ Dynamic: license-file
38
39
  A lightweight Python library to build Rubika bots easily.
39
40
 
40
41
  <div align="center">
41
- <img src="http://rubigram.ir/Rubigram.jpg" alt="Rubigram Logo" width="200"/>
42
+ <img src="http://rubigram.ir/rubigram.jpg" alt="Rubigram Logo" width="200"/>
42
43
  </div>
43
44
 
44
45
 
@@ -0,0 +1,71 @@
1
+ rubigram/__init__.py,sha256=sn1Rt8Wy0xALHUfuJ3UItSBmFxQniBAOkwFIrifO7-E,63
2
+ rubigram/client.py,sha256=LCjXLbnpj-A6sHA-hK9--Q-pttrGtXrjNePbuC2yR7g,4638
3
+ rubigram/enums.py,sha256=vsqi2z5oh88ld84uu8JacQuuUbO-3yAbnvcpVXu7r_U,2831
4
+ rubigram/filters.py,sha256=yBpXgBBLfdmYATdgG3CArWgjQkavhYsk4KxPQTK--uk,22520
5
+ rubigram/handler.py,sha256=8Odr47k4plVsxDM4XWx8KBH5Jra6EaC8CqwMOxqZ8SI,579
6
+ rubigram/http.py,sha256=sOb8Dge0Cumrqq7LANLQ9PyJcHcQepWgsrjjfC0yol4,947
7
+ rubigram/logger.py,sha256=laZsNXUO_xQLLBgi-fgdgcJK05Fo5icOHe_mbib6ggg,595
8
+ rubigram/state.py,sha256=A9HV4WC8pCvwyhUtnPjZo3sC7ANxdlaoqgoia08YGgo,948
9
+ rubigram/method/__init__.py,sha256=Hi7S1TKYRtYRPGFxP5UNp4xPQR0ItO3Yqbv344Og6NI,331
10
+ rubigram/method/chat/__init__.py,sha256=96XDMbiM8EtjsN5mflWNJYwwR5kEXUQHYnXgDG38TbA,163
11
+ rubigram/method/chat/get_chat.py,sha256=13ya3lsZXVlRKCHRprMQVpW3ulhyCJVJvcDlApQFsfI,782
12
+ rubigram/method/chat/get_me.py,sha256=TB5SrB76ipJKN5xvFB5IXSzHV2fpzjIwm14mV4GoXi4,749
13
+ rubigram/method/chat/get_update.py,sha256=1DTZA8tY1xn-5f13hnvruuF7NfQeYi6gWlF9E5_HL9U,1158
14
+ rubigram/method/decorator/__init__.py,sha256=rdBWElrecWRnHXTPV1E5Y0zmnG14xU0nKtYmgNfmQso,422
15
+ rubigram/method/decorator/on_delete_message.py,sha256=X4FQ4qtu_HcLGrgvB2Bx-PmjD-XeDh3zuc9IzJUhCJY,1407
16
+ rubigram/method/decorator/on_edit_message.py,sha256=paxlFV5huK7QShZP6M41WsjCPUS_Wj2RGp9hBrkapkM,1382
17
+ rubigram/method/decorator/on_inline_message.py,sha256=GByo-f4LsdHD9Iai-4VlEP2tnFU9-qljB9VP363ggW0,1455
18
+ rubigram/method/decorator/on_message.py,sha256=8v5aAoff2deONTL5SzHpA8pcyL4SIsKa2HehZVoKBs4,1376
19
+ rubigram/method/decorator/on_start.py,sha256=2T0qImfwS2YhRoT_L5yVbyps1YCs3mikq4CRMuAFEb0,976
20
+ rubigram/method/decorator/on_stop.py,sha256=uUjIIsKOw8lwDTW1eUatsZAD9zYzj4DyXGNVvlqgTkA,935
21
+ rubigram/method/decorator/register.py,sha256=t0vWgapNEU0IQErhfeZoV1ghPcA3D2zHJcpaSoQI-6Y,1717
22
+ rubigram/method/file/__init__.py,sha256=KBOWQE7MrDZ51i-VYkxJ-5wqYslkS1XbSnbgWKHU4FE,822
23
+ rubigram/method/file/download_file.py,sha256=6k6DfZbAAgQBfoPMnqN3CHOneF-jtB9fuKnckyTG834,1216
24
+ rubigram/method/file/get_bytes.py,sha256=rIRQAF_NIF388A33-IROLFUt50MgoQ_92QAXFmfEeIE,754
25
+ rubigram/method/file/get_file.py,sha256=5-TtwjiQw_KaKVn6y0poW5H73NvEybCJyT2C73taCsY,784
26
+ rubigram/method/file/get_file_name.py,sha256=9kz6Tuyz3WSOgNLeUpKFzcqohBS-AAoklTo9lnRkxEU,834
27
+ rubigram/method/file/request_download_file.py,sha256=hkP6SslKZ6Ijv4b04weX4rtQjxcH22_QJtEQfYXdpVU,1103
28
+ rubigram/method/file/request_send_file.py,sha256=9cuMvA6YVih8yqEzVAhzve6NWUpoznnAbtNq34qFF5A,883
29
+ rubigram/method/file/request_upload_file.py,sha256=J__u6IZce6rXtnfL42WHNn7RwoQIh56FJ1falzlw7y0,2264
30
+ rubigram/method/file/send_document.py,sha256=5i9pvizZd2VwyeG_nSv1LUDqNjhWAwbJKhM_FMVExOU,2731
31
+ rubigram/method/file/send_file.py,sha256=p-TcElAKtbEgISYC6SdXq03pJyARH8p3mDO2KFMR14s,3387
32
+ rubigram/method/file/send_gif.py,sha256=84IAoWbPJO0BoJXVc5ers3Y2WLG6Fs55lOIli6DokDo,2666
33
+ rubigram/method/file/send_music.py,sha256=Bg084LDQOEWDTdp22htgT4FiKPPg-iTfNAjHm0CWauQ,2702
34
+ rubigram/method/file/send_photo.py,sha256=J8Duj37e02LVc0RL1Xy86mkuQuL5rPgipXpQoxON8F4,2730
35
+ rubigram/method/file/send_video.py,sha256=kX2pUVvy3nZ8chfe02m376ABxtdcW6UI30OKJDYbU5o,2725
36
+ rubigram/method/file/send_voice.py,sha256=omGtXeXl-SXFSN0V0bKxesmcLAfSH-SZZM6BWhuqZk0,2544
37
+ rubigram/method/messages/__init__.py,sha256=dpWTrOohcZ8eJk7jTdMmcPNt_rYfiNN7exnLlTyHRbQ,782
38
+ rubigram/method/messages/delete_message.py,sha256=ABWasWR5UaQ2HgdTd4WNmumoF5FIJuhR9ZXVqMnKW5s,1540
39
+ rubigram/method/messages/edit_chat_keypad.py,sha256=VkF1cuOGAbHVkXieP9MDaRjCsWQzMqgge54RFCorvDk,1126
40
+ rubigram/method/messages/edit_message.py,sha256=fne5WPXYV29_aeU16VLVo6gHYXbsaGuEzvpE17KGcoI,1785
41
+ rubigram/method/messages/edit_message_keypad.py,sha256=KQ0I3Rf8jt3RcOrfYNQA_OrfAg1DEDYably-8Zq_mX0,1439
42
+ rubigram/method/messages/edit_message_text.py,sha256=5NJ-WpC-hgExYMuKUzcI_d7VYLqTiBzB3KpJQY1SsDQ,1092
43
+ rubigram/method/messages/forward_message.py,sha256=ZlPDVDi7XG5boLgTsM9X2gP80E0aSvJ-pX21fGuhJKM,1694
44
+ rubigram/method/messages/remove_chat_keypad.py,sha256=eL4ebghrVnnIZp5zrCqJiZAPQQM0PcSOdcW5yF1bZHM,805
45
+ rubigram/method/messages/send_contact.py,sha256=9kBbmLqA8RtCC1jSE1RcomdL6ThxbsauXSijWMnwbc8,3140
46
+ rubigram/method/messages/send_location.py,sha256=np4AoCRsFYoNmJfuIMAUw3GIChGebeWdYTxk9fw6pY0,2974
47
+ rubigram/method/messages/send_message.py,sha256=Pb3NhbbCPDTxKim93R_vI1jidGDWecA_aVLGne4J-Sg,2874
48
+ rubigram/method/messages/send_poll.py,sha256=u3QUY-fciE7VkYd6neNaC0F3tXggFCfIoyypoNKdznY,3043
49
+ rubigram/method/messages/send_sticker.py,sha256=DAG9EpTjl-U2chD9Hjxw9aVSkzysA2VjtMs_5GtAm30,2843
50
+ rubigram/method/network/__init__.py,sha256=Vp7CyfWgU0AmkEWXwWkpXKPlB3h_7rWpgwY0baQ0pIs,75
51
+ rubigram/method/network/request.py,sha256=ECBAygYsoKiT8DQgUqCrjZFHLacG0358CX43Udu7VV8,570
52
+ rubigram/method/setting/__init__.py,sha256=fc29gUps7yI6cQDDwhLfVprE3oOXEq2IjDFcWiwrHEg,165
53
+ rubigram/method/setting/set_command.py,sha256=kg16vacEUoLdJ4gALIhVzjg0NGxetIrTfyq8NkDUBZI,933
54
+ rubigram/method/setting/update_bot_endpoint.py,sha256=SEFngT5LvYbPQ7w2aPbQy75MOdEfyn6ixmTsEWygu2I,972
55
+ rubigram/method/utilities/__init__.py,sha256=F098uwyxCHhtfxgvQnCzS4GTPywMlFbPdWHC-DPS5fU,189
56
+ rubigram/method/utilities/dispatch.py,sha256=f30aBDwcfYig4HFQ88msdtIZVcpm0YFWQL5KkFk7K-A,805
57
+ rubigram/method/utilities/setup_endpoint.py,sha256=BypRjeg4ECX6xf72-mNZ6DTW99GVRlwAIPeZJ9Dycmo,539
58
+ rubigram/method/utilities/updater.py,sha256=bGmu7PdFDRYAWckPXCAjtS0M-3DcOO8zB4draVDp_2Q,438
59
+ rubigram/rubino/__init__.py,sha256=6-ztB6rLeIB3SV4tbVPPUxmNqHQUYQhDee6bnNQdECw,26
60
+ rubigram/rubino/client.py,sha256=XWy4cg_Lc96eRsy8OYPffyGktiMkS7yfG4ackY226Ls,14563
61
+ rubigram/rubino/network.py,sha256=13EH4GpBEUZwRLOjJKw5_1MY_5METcqb5qK_F5NBxIE,3814
62
+ rubigram/types/__init__.py,sha256=i5VL2yv2HlyQdQdx2Qxv0Y3luT5GYVnYuI5Vm7MtvSg,69
63
+ rubigram/types/messages.py,sha256=Go5LVw9kX-7FrxRpxK3S2sS-427zCbtg_2Q3CNdZc-0,5744
64
+ rubigram/types/object.py,sha256=UhzOrPTsLrLv9pWVwiyWbaXqwAeNJczQ0cBsf0bHPU0,4139
65
+ rubigram/types/types.py,sha256=ti-JGIxhEvjl8hwfIucJkW_PDorh2gDCDUtVMYofT78,5744
66
+ rubigram/types/updates.py,sha256=HDAJaA8bg9GwbGXSDSwAZ5JFyDwAhVxAXByv4pIGvGA,23624
67
+ rubigramclient-1.7.3.dist-info/licenses/LICENSE,sha256=W2bekuLJMG2c-8SvTkJflMF5wY_Mx6rsXfXoCQvRzOI,1081
68
+ rubigramclient-1.7.3.dist-info/METADATA,sha256=rk4PpagEUSiZiTTjdRuePPg5jgAxdVWg5gGv6boyC2A,4548
69
+ rubigramclient-1.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ rubigramclient-1.7.3.dist-info/top_level.txt,sha256=Mhg5HfkL6rLec5sI4ClGmwoqYUANAZUz8sVa1sT_cas,9
71
+ rubigramclient-1.7.3.dist-info/RECORD,,