RubigramClient 1.7.17__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.
Files changed (132) hide show
  1. rubigram/__init__.py +15 -0
  2. rubigram/client.py +294 -0
  3. rubigram/enums/__init__.py +52 -0
  4. rubigram/enums/buttons/__init__.py +13 -0
  5. rubigram/enums/buttons/button_calendar_type.py +20 -0
  6. rubigram/enums/buttons/button_location_type.py +20 -0
  7. rubigram/enums/buttons/button_selection_get_type.py +20 -0
  8. rubigram/enums/buttons/button_selection_search_type.py +20 -0
  9. rubigram/enums/buttons/button_selection_type.py +22 -0
  10. rubigram/enums/buttons/button_textbox_type_keypad.py +20 -0
  11. rubigram/enums/buttons/button_textbox_type_line.py +20 -0
  12. rubigram/enums/buttons/button_type.py +58 -0
  13. rubigram/enums/chat_action_type.py +22 -0
  14. rubigram/enums/chat_keypad_type.py +20 -0
  15. rubigram/enums/chat_type.py +24 -0
  16. rubigram/enums/enum.py +6 -0
  17. rubigram/enums/file_type.py +28 -0
  18. rubigram/enums/forwarded_from_type.py +22 -0
  19. rubigram/enums/live_location_status.py +20 -0
  20. rubigram/enums/message_sender_type.py +20 -0
  21. rubigram/enums/metadata_type.py +18 -0
  22. rubigram/enums/parse_mode.py +20 -0
  23. rubigram/enums/payment_status_type.py +20 -0
  24. rubigram/enums/poll_status_type.py +20 -0
  25. rubigram/enums/update_endpoint_type.py +26 -0
  26. rubigram/enums/update_type.py +28 -0
  27. rubigram/errors.py +16 -0
  28. rubigram/filters.py +865 -0
  29. rubigram/http_session.py +96 -0
  30. rubigram/methods/__init__.py +26 -0
  31. rubigram/methods/chats/__init__.py +10 -0
  32. rubigram/methods/chats/get_chat.py +53 -0
  33. rubigram/methods/decorators/__init__.py +25 -0
  34. rubigram/methods/decorators/on_inline_message.py +70 -0
  35. rubigram/methods/decorators/on_message.py +62 -0
  36. rubigram/methods/decorators/on_remove_message.py +65 -0
  37. rubigram/methods/decorators/on_start.py +65 -0
  38. rubigram/methods/decorators/on_started_bot.py +70 -0
  39. rubigram/methods/decorators/on_stop.py +65 -0
  40. rubigram/methods/decorators/on_stopped_bot.py +70 -0
  41. rubigram/methods/decorators/on_update_message.py +70 -0
  42. rubigram/methods/files/__init__.py +32 -0
  43. rubigram/methods/files/download_file.py +118 -0
  44. rubigram/methods/files/get_file.py +41 -0
  45. rubigram/methods/files/get_file_name.py +41 -0
  46. rubigram/methods/files/request_send_file.py +49 -0
  47. rubigram/methods/files/send_file.py +133 -0
  48. rubigram/methods/files/send_gif.py +51 -0
  49. rubigram/methods/files/send_music.py +97 -0
  50. rubigram/methods/files/send_photo.py +95 -0
  51. rubigram/methods/files/send_video.py +96 -0
  52. rubigram/methods/files/send_voice.py +96 -0
  53. rubigram/methods/files/upload_file.py +114 -0
  54. rubigram/methods/messages/__init__.py +34 -0
  55. rubigram/methods/messages/delete_messages.py +84 -0
  56. rubigram/methods/messages/edit_chat_keypad.py +68 -0
  57. rubigram/methods/messages/edit_message.py +82 -0
  58. rubigram/methods/messages/edit_message_keypad.py +72 -0
  59. rubigram/methods/messages/edit_message_text.py +68 -0
  60. rubigram/methods/messages/forward_message.py +78 -0
  61. rubigram/methods/messages/remove_chat_keypad.py +46 -0
  62. rubigram/methods/messages/send_contact.py +114 -0
  63. rubigram/methods/messages/send_location.py +108 -0
  64. rubigram/methods/messages/send_message.py +115 -0
  65. rubigram/methods/messages/send_poll.py +104 -0
  66. rubigram/methods/messages/send_sticker.py +98 -0
  67. rubigram/methods/network/__init__.py +12 -0
  68. rubigram/methods/network/request.py +129 -0
  69. rubigram/methods/settings/__init__.py +16 -0
  70. rubigram/methods/settings/set_command.py +50 -0
  71. rubigram/methods/settings/setup_endpoints.py +48 -0
  72. rubigram/methods/settings/update_bot_endpoint.py +62 -0
  73. rubigram/methods/updates/__init__.py +14 -0
  74. rubigram/methods/updates/get_me.py +35 -0
  75. rubigram/methods/updates/get_update.py +62 -0
  76. rubigram/methods/utilities/__init__.py +14 -0
  77. rubigram/methods/utilities/dispatcher.py +66 -0
  78. rubigram/methods/utilities/run.py +118 -0
  79. rubigram/rubino/__init__.py +6 -0
  80. rubigram/rubino/client.py +374 -0
  81. rubigram/rubino/network.py +129 -0
  82. rubigram/server/__init__.py +6 -0
  83. rubigram/server/server.py +245 -0
  84. rubigram/state/__init__.py +7 -0
  85. rubigram/state/state.py +121 -0
  86. rubigram/state/storage.py +131 -0
  87. rubigram/types/__init__.py +66 -0
  88. rubigram/types/aux_data.py +28 -0
  89. rubigram/types/bot.py +51 -0
  90. rubigram/types/bot_command.py +26 -0
  91. rubigram/types/buttons/__init__.py +13 -0
  92. rubigram/types/buttons/button.py +59 -0
  93. rubigram/types/buttons/button_calendar.py +40 -0
  94. rubigram/types/buttons/button_location.py +40 -0
  95. rubigram/types/buttons/button_number_picker.py +34 -0
  96. rubigram/types/buttons/button_selection.py +48 -0
  97. rubigram/types/buttons/button_selection_item.py +32 -0
  98. rubigram/types/buttons/button_string_picker.py +29 -0
  99. rubigram/types/buttons/button_text_box.py +40 -0
  100. rubigram/types/chat.py +86 -0
  101. rubigram/types/config/__init__.py +6 -0
  102. rubigram/types/config/object.py +442 -0
  103. rubigram/types/contact_message.py +29 -0
  104. rubigram/types/file.py +78 -0
  105. rubigram/types/forwarded_from.py +39 -0
  106. rubigram/types/keypads/__init__.py +7 -0
  107. rubigram/types/keypads/keypad.py +31 -0
  108. rubigram/types/keypads/keypad_row.py +23 -0
  109. rubigram/types/live_location.py +44 -0
  110. rubigram/types/location.py +24 -0
  111. rubigram/types/messages/__init__.py +8 -0
  112. rubigram/types/messages/inline_message.py +78 -0
  113. rubigram/types/messages/message.py +117 -0
  114. rubigram/types/messages/update_message.py +341 -0
  115. rubigram/types/metadata/__init__.py +7 -0
  116. rubigram/types/metadata/metadata.py +43 -0
  117. rubigram/types/metadata/metadata_parts.py +42 -0
  118. rubigram/types/payment_status.py +30 -0
  119. rubigram/types/poll.py +32 -0
  120. rubigram/types/poll_status.py +40 -0
  121. rubigram/types/sticker.py +33 -0
  122. rubigram/types/updates/__init__.py +7 -0
  123. rubigram/types/updates/update.py +917 -0
  124. rubigram/types/updates/updates.py +56 -0
  125. rubigram/utils/__init__.py +14 -0
  126. rubigram/utils/auto_delete.py +93 -0
  127. rubigram/utils/parser.py +99 -0
  128. rubigramclient-1.7.17.dist-info/METADATA +215 -0
  129. rubigramclient-1.7.17.dist-info/RECORD +132 -0
  130. rubigramclient-1.7.17.dist-info/WHEEL +5 -0
  131. rubigramclient-1.7.17.dist-info/licenses/LICENSE +21 -0
  132. rubigramclient-1.7.17.dist-info/top_level.txt +1 -0
@@ -0,0 +1,59 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional, Union
9
+ from dataclasses import dataclass
10
+ from ..config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class Button(Object):
16
+ """
17
+ **Represents a generic interactive button in a chat keypad.**
18
+ `from rubigram.types import Button`
19
+
20
+ Attributes:
21
+ id (`str`):
22
+ Unique identifier of the button.
23
+
24
+ button_text (`str`):
25
+ Text displayed on the button.
26
+
27
+ type (`Optional[Union[str, rubigram.enums.ButtonType]]`):
28
+ Type of the button.
29
+
30
+ button_selection (`Optional[rubigram.types.ButtonSelection]`):
31
+ Selection-type button.
32
+
33
+ button_calendar (`Optional[rubigram.types.ButtonCalendar]`):
34
+ Calendar-type button.
35
+
36
+ button_number_picker (`Optional[rubigram.types.ButtonNumberPicker]`):
37
+ Number-picker button.
38
+
39
+ button_string_picker (`Optional[rubigram.types.ButtonStringPicker]`):
40
+ String-picker button.
41
+
42
+ button_location (`Optional[rubigram.types.ButtonLocation]`):
43
+ Location picker button.
44
+
45
+ button_textbox (`Optional[rubigram.types.ButtonTextbox]`):
46
+ Textbox input button.
47
+
48
+ button_link (`Optional[rubigram.types.ButtonLink]`):
49
+ Link-type button.
50
+ """
51
+ id: str
52
+ button_text: str
53
+ type: Optional[Union[str, rubigram.enums.ButtonType]] = rubigram.enums.ButtonType.SIMPLE
54
+ button_selection: Optional[rubigram.types.ButtonSelection] = None
55
+ button_calendar: Optional[rubigram.types.ButtonCalendar] = None
56
+ button_number_picker: Optional[rubigram.types.ButtonNumberPicker] = None
57
+ button_string_picker: Optional[rubigram.types.ButtonStringPicker] = None
58
+ button_location: Optional[rubigram.types.ButtonLocation] = None
59
+ button_textbox: Optional[rubigram.types.ButtonTextbox] = None
@@ -0,0 +1,40 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional, Union
9
+ from dataclasses import dataclass
10
+ from ..config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class ButtonCalendar(Object):
16
+ """
17
+ **Represents a calendar picker button.**
18
+ `from rubigram.types import ButtonCalendar`
19
+
20
+ Attributes:
21
+ default_value (`Optional[str]`):
22
+ The default selected date.
23
+
24
+ type (`Optional[Union[str, rubigram.enums.ButtonCalendarType]]`):
25
+ Type of calendar picker.
26
+
27
+ min_year (`Optional[str]`):
28
+ Minimum selectable year.
29
+
30
+ max_year (`Optional[str]`):
31
+ Maximum selectable year.
32
+
33
+ title (`Optional[str]`):
34
+ Title of the calendar picker.
35
+ """
36
+ default_value: Optional[str] = None
37
+ type: Optional[Union[str, rubigram.enums.ButtonCalendarType]] = None
38
+ min_year: Optional[str] = None
39
+ max_year: Optional[str] = None
40
+ title: Optional[str] = None
@@ -0,0 +1,40 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional, Union
9
+ from dataclasses import dataclass
10
+ from ..config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class ButtonLocation(Object):
16
+ """
17
+ **Represents a location picker button.**
18
+ `from rubigram.types import ButtonLocation`
19
+
20
+ Attributes:
21
+ default_pointer_location (`Optional[rubigram.types.Location]`):
22
+ Default pointer location.
23
+
24
+ default_map_location (`Optional[rubigram.types.Location]`):
25
+ Default map location.
26
+
27
+ type (`Optional[Union[str, rubigram.enums.ButtonLocationType]]`):
28
+ Type of location picker.
29
+
30
+ title (`Optional[str]`):
31
+ Title of the location picker.
32
+
33
+ location_image_url (`Optional[str]`):
34
+ Optional image URL for the location.
35
+ """
36
+ default_pointer_location: Optional[rubigram.types.Location] = None
37
+ default_map_location: Optional[rubigram.types.Location] = None
38
+ type: Optional[Union[str, rubigram.enums.ButtonLocationType]] = None
39
+ title: Optional[str] = None
40
+ location_image_url: Optional[str] = None
@@ -0,0 +1,34 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from typing import Optional
7
+ from dataclasses import dataclass
8
+ from ..config import Object
9
+
10
+
11
+ @dataclass
12
+ class ButtonNumberPicker(Object):
13
+ """
14
+ **Represents a number picker button.**
15
+ `from rubigram.types import ButtonNumberPicker`
16
+
17
+ Attributes:
18
+ min_value (`Optional[str]`):
19
+ Minimum selectable number.
20
+
21
+ max_value (`Optional[str]`):
22
+ Maximum selectable number.
23
+
24
+ default_value (`Optional[str]`):
25
+ Default selected number.
26
+
27
+ title (`Optional[str]`):
28
+ Title of the number picker.
29
+ """
30
+
31
+ min_value: Optional[str] = None
32
+ max_value: Optional[str] = None
33
+ default_value: Optional[str] = None
34
+ title: Optional[str] = None
@@ -0,0 +1,48 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional
9
+ from dataclasses import dataclass
10
+ from ..config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class ButtonSelection(Object):
16
+ """
17
+ **Represents a selection of multiple items that can be shown in a button.**
18
+ `from rubigram.types import ButtonSelection`
19
+
20
+ Attributes:
21
+ selection_id (`Optional[str]`):
22
+ Unique identifier for this selection.
23
+
24
+ search_type (`Optional[str]`):
25
+ Type of search to filter items.
26
+
27
+ get_type (`Optional[str]`):
28
+ Type of retrieval for items.
29
+
30
+ items (`Optional[list[rubigram.types.ButtonSelectionItem]]`):
31
+ List of items in the selection.
32
+
33
+ is_multi_selection (`Optional[bool]`):
34
+ Whether multiple items can be selected.
35
+
36
+ columns_count (`Optional[str]`):
37
+ Number of columns to display items in.
38
+
39
+ title (`Optional[str]`):
40
+ Title displayed above the selection.
41
+ """
42
+ selection_id: Optional[str] = None
43
+ search_type: Optional[str] = None
44
+ get_type: Optional[str] = None
45
+ items: Optional[list[rubigram.types.ButtonSelectionItem]] = None
46
+ is_multi_selection: Optional[bool] = None
47
+ columns_count: Optional[str] = None
48
+ title: Optional[str] = None
@@ -0,0 +1,32 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional, Union
9
+ from dataclasses import dataclass
10
+ from ..config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class ButtonSelectionItem(Object):
16
+ """
17
+ **Represents an individual selectable item in a ButtonSelection.**
18
+ `from rubigram.types import ButtonSelectionItem`
19
+
20
+ Attributes:
21
+ text (`Optional[str]`):
22
+ The display text of the item.
23
+
24
+ image_url (`Optional[str]`):
25
+ Optional URL for an image representing the item.
26
+
27
+ type (`Optional[Union[str, rubigram.enums.ButtonSelectionType]]`):
28
+ Type of selection item.
29
+ """
30
+ text: Optional[str] = None
31
+ image_url: Optional[str] = None
32
+ type: Optional[Union[str, rubigram.enums.ButtonSelectionType]] = None
@@ -0,0 +1,29 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from typing import Optional
7
+ from dataclasses import dataclass
8
+ from ..config import Object
9
+
10
+
11
+ @dataclass
12
+ class ButtonStringPicker(Object):
13
+ """
14
+ **Represents a string picker button.**
15
+ `from rubigram.types import ButtonStringPicker`
16
+
17
+ Attributes:
18
+ items (`Optional[list[str]]`):
19
+ List of string options to select from.
20
+
21
+ default_value (`Optional[str]`):
22
+ Default selected string.
23
+
24
+ title (`Optional[str]`):
25
+ Title of the string picker.
26
+ """
27
+ items: Optional[list[str]] = None
28
+ default_value: Optional[str] = None
29
+ title: Optional[str] = None
@@ -0,0 +1,40 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional, Union
9
+ from dataclasses import dataclass
10
+ from ..config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class ButtonTextbox(Object):
16
+ """
17
+ **Represents a textbox input button.**
18
+ `from rubigram.types import ButtonTextbox`
19
+
20
+ Attributes:
21
+ type_line (`Optional[Union[str, rubigram.enums.ButtonTextboxTypeLine]]`):
22
+ Line type for the textbox.
23
+
24
+ type_keypad (`Optional[Union[str, rubigram.enums.ButtonTextboxTypeKeypad]]`):
25
+ Keypad type for the textbox.
26
+
27
+ place_holder (`Optional[str]`):
28
+ Placeholder text.
29
+
30
+ title (`Optional[str]`):
31
+ Title of the textbox.
32
+
33
+ default_value (`Optional[str]`):
34
+ Default text in the textbox.
35
+ """
36
+ type_line: Optional[Union[str, rubigram.enums.ButtonTextboxTypeLine]] = None
37
+ type_keypad: Optional[Union[str, rubigram.enums.ButtonTextboxTypeKeypad]] = None
38
+ place_holder: Optional[str] = None
39
+ title: Optional[str] = None
40
+ default_value: Optional[str] = None
rubigram/types/chat.py ADDED
@@ -0,0 +1,86 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from __future__ import annotations
7
+
8
+ from typing import Optional, Union
9
+ from dataclasses import dataclass
10
+ from .config import Object
11
+ import rubigram
12
+
13
+
14
+ @dataclass
15
+ class Chat(Object):
16
+ """
17
+ **Represents a chat entity in Rubigram.**
18
+ `from rubigram.types import Chat`
19
+
20
+ This object can represent different types of chats such as private, group, or channel.
21
+ It contains identifying and descriptive information about the chat, including user
22
+ details for private chats and titles for groups/channels.
23
+
24
+ Attributes:
25
+ chat_id (`str`):
26
+ Unique identifier for the chat.
27
+
28
+ chat_type (`rubigram.enums.ChatType`):
29
+ Type of chat (e.g., User, Group, Channel).
30
+
31
+ user_id (`str`):
32
+ The user ID of the chat owner (for private chats).
33
+
34
+ first_name (`Optional[str]`):
35
+ First name of the user (if applicable).
36
+
37
+ last_name (`Optional[str]`):
38
+ Last name of the user (if applicable).
39
+
40
+ title (`Optional[str]`):
41
+ Title of the chat (for groups and channels).
42
+
43
+ username (`Optional[str]`):
44
+ Username of the chat or user (if available).
45
+
46
+ full_name (`Optional[str]`):
47
+ Full name of the user.
48
+ """
49
+
50
+ chat_id: str
51
+ chat_type: Union[str, rubigram.enums.ChatType]
52
+ user_id: str
53
+ first_name: Optional[str] = None
54
+ last_name: Optional[str] = None
55
+ title: Optional[str] = None
56
+ username: Optional[str] = None
57
+
58
+ @property
59
+ def full_name(self) -> str:
60
+ """
61
+ Return the full name of the user (first + last).
62
+
63
+ Combines `first_name` and `last_name` with a space. If one of them
64
+ is missing, it returns only the available name. Returns an empty
65
+ string if both are None.
66
+
67
+ Returns:
68
+ str: Full name of the user.
69
+ """
70
+ first = self.first_name or ""
71
+ last = self.last_name or ""
72
+ return (first + " " + last).strip()
73
+
74
+ def as_dict(self) -> dict:
75
+ """
76
+ Convert this Chat object into a dictionary representation.
77
+
78
+ Extends the base Object.as_dict() method to include the `full_name`
79
+ property in the dictionary output.
80
+
81
+ Returns:
82
+ dict: Dictionary containing all chat attributes, including `full_name`.
83
+ """
84
+ data = super().as_dict()
85
+ data["full_name"] = self.full_name
86
+ return data
@@ -0,0 +1,6 @@
1
+ # RubigramClient - Rubika API library for python
2
+ # Copyright (C) 2025-present Javad <https://github.com/DevJavad>
3
+ # Github - https://github.com/DevJavad/rubigram
4
+
5
+
6
+ from .object import Object