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,28 @@
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 .enum import Enum
7
+
8
+
9
+ class FileType(Enum):
10
+ """
11
+ **Represents the different types of files that can be sent or received.**
12
+ `from rubigram.enums import FileType`
13
+
14
+ Attributes:
15
+ FILE (str): A generic file.
16
+ IMAGE (str): An image file.
17
+ VIDEO (str): A video file.
18
+ GIF (str): A GIF file.
19
+ MUSIC (str): An audio/music file.
20
+ VOICE (str): A voice message file.
21
+ """
22
+
23
+ FILE = "File"
24
+ IMAGE = "Image"
25
+ VIDEO = "Video"
26
+ GIF = "Gif"
27
+ MUSIC = "Music"
28
+ VOICE = "Voice"
@@ -0,0 +1,22 @@
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 .enum import Enum
7
+
8
+
9
+ class ForwardedFromType(Enum):
10
+ """
11
+ **Represents the original sender of a forwarded message.**
12
+ `from rubigram.enums import ForwardedFromType`
13
+
14
+ Attributes:
15
+ USER (str): The message was forwarded from a user.
16
+ BOT (str): The message was forwarded from a bot.
17
+ CHANNEL (str): The message was forwarded from a channel.
18
+ """
19
+
20
+ USER = "User"
21
+ BOT = "Bot"
22
+ CHANNEL = "Channel"
@@ -0,0 +1,20 @@
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 .enum import Enum
7
+
8
+
9
+ class LiveLocationStatus(Enum):
10
+ """
11
+ **Represents the status of a live location.**
12
+ `from rubigram.enums import LiveLocationStatus`
13
+
14
+ Attributes:
15
+ STOPPED (str): The live location has been stopped.
16
+ LIVE (str): The live location is currently active.
17
+ """
18
+
19
+ STOPPED = "Stopped"
20
+ LIVE = "Live"
@@ -0,0 +1,20 @@
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 .enum import Enum
7
+
8
+
9
+ class MessageSenderType(Enum):
10
+ """
11
+ **Represents the sender type of a message.**
12
+ `from rubigram.enums import MessageSenderType`
13
+
14
+ Attributes:
15
+ USER (str): The message was sent by a user.
16
+ BOT (str): The message was sent by a bot.
17
+ """
18
+
19
+ USER = "User"
20
+ BOT = "Bot"
@@ -0,0 +1,18 @@
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 .enum import Enum
7
+
8
+
9
+ class MetadataType(Enum):
10
+ BOLD = "Bold"
11
+ MONO = "Mono"
12
+ LINK = "Link"
13
+ QUOTE = "Quote"
14
+ ITALIC = "Italic"
15
+ STRIKE = "Strike"
16
+ SPOILER = "Spoiler"
17
+ UNDERLINE = "Underline"
18
+ MENTION_TETX = "MentionText"
@@ -0,0 +1,20 @@
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 .enum import Enum
7
+
8
+
9
+ class ParseMode(Enum):
10
+ """
11
+ **Represents the text parsing modes for messages.**
12
+ `from rubigram.enums import ParseMode`
13
+
14
+ Attributes:
15
+ MARKDOWN (str): Parses the message as Markdown.
16
+ HTML (str): Parses the message as HTML.
17
+ """
18
+
19
+ MARKDOWN = "markdown"
20
+ HTML = "html"
@@ -0,0 +1,20 @@
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 .enum import Enum
7
+
8
+
9
+ class PaymentStatusType(Enum):
10
+ """
11
+ **Represents the payment status of an item or transaction.**
12
+ `from rubigram.enums import PaymentStatusType`
13
+
14
+ Attributes:
15
+ PAID (str): The payment has been completed.
16
+ NOT_PAID (str): The payment has not been completed.
17
+ """
18
+
19
+ PAID = "Paid"
20
+ NOT_PAID = "NotPaid"
@@ -0,0 +1,20 @@
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 .enum import Enum
7
+
8
+
9
+ class PollStatusType(Enum):
10
+ """
11
+ **Represents the status of a poll.**
12
+ `from rubigram.enums import PollStatusType`
13
+
14
+ Attributes:
15
+ OPEN (str): The poll is currently open and accepting votes.
16
+ CLOSED (str): The poll is closed and no longer accepting votes.
17
+ """
18
+
19
+ OPEN = "Open"
20
+ CLOSED = "Closed"
@@ -0,0 +1,26 @@
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 .enum import Enum
7
+
8
+
9
+ class UpdateEndpointType(Enum):
10
+ """
11
+ **Represents the types of endpoints that can trigger updates.**
12
+ `from rubigram.enums import UpdateEndpointType`
13
+
14
+ Attributes:
15
+ RECEIVE_UPDATE (str): Updates triggered by receiving a standard update.
16
+ RECEIVE_INLINE_MESSAGE (str): Updates triggered by receiving an inline message.
17
+ RECEIVE_QUERY (str): Updates triggered by receiving a query.
18
+ GET_SELECTION_ITEM (str): Updates triggered when retrieving a selection item.
19
+ SEARCH_SELECTION_ITEMS (str): Updates triggered when searching selection items.
20
+ """
21
+
22
+ RECEIVE_UPDATE = "ReceiveUpdate"
23
+ RECEIVE_INLINE_MESSAGE = "ReceiveInlineMessage"
24
+ RECEIVE_QUERY = "ReceiveQuery"
25
+ GET_SELECTION_ITEM = "GetSelectionItem"
26
+ SEARCH_SELECTION_ITEMS = "SearchSelectionItems"
@@ -0,0 +1,28 @@
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 .enum import Enum
7
+
8
+
9
+ class UpdateType(Enum):
10
+ """
11
+ **Represents the types of updates that can occur in a chat or bot.**
12
+ `from rubigram.enums import UpdateType`
13
+
14
+ Attributes:
15
+ UPDATED_MESSAGE (str): A message was updated.
16
+ NEW_MESSAGE (str): A new message was received.
17
+ REMOVED_MESSAGE (str): A message was removed.
18
+ STARTED_BOT (str): A bot was started.
19
+ STOPPED_BOT (str): A bot was stopped.
20
+ UPDATED_PAYMENT (str): A payment status was updated.
21
+ """
22
+
23
+ UPDATED_MESSAGE = "UpdatedMessage"
24
+ NEW_MESSAGE = "NewMessage"
25
+ REMOVED_MESSAGE = "RemovedMessage"
26
+ STARTED_BOT = "StartedBot"
27
+ STOPPED_BOT = "StoppedBot"
28
+ UPDATED_PAYMENT = "UpdatedPayment"
rubigram/errors.py ADDED
@@ -0,0 +1,16 @@
1
+ class InvalidInput(Exception):
2
+ def __init__(self, data: dict):
3
+ self.status = data.get("status")
4
+ self.message = data.get("dev_message")
5
+
6
+ def __str__(self):
7
+ return f"InvalidInputError(status={self.status}), message={self.message}"
8
+
9
+
10
+ class InvalidAccess(Exception):
11
+ def __init__(self, data: dict):
12
+ self.status = data.get("status")
13
+ self.message = data.get("dev_message")
14
+
15
+ def __str__(self):
16
+ return f"InvalidAccessError(status={self.status}), message={self.message}"