Rubka 7.1.3__py3-none-any.whl → 7.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Rubka might be problematic. Click here for more details.

rubka/asynco.py CHANGED
@@ -194,9 +194,8 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
194
194
  async with session.get(self.web_hook, timeout=self.timeout) as response:
195
195
  response.raise_for_status()
196
196
  data = await response.json()
197
- print(data)
197
+ if data:print(f"[INFO] Retrieving WebHook URL information...")
198
198
  json_url = data.get('url', self.web_hook)
199
- print(self.web_hook)
200
199
  for endpoint_type in [
201
200
  "ReceiveUpdate",
202
201
  "ReceiveInlineMessage",
@@ -205,7 +204,8 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
205
204
  "SearchSelectionItems"
206
205
  ]:
207
206
  result = await self.update_bot_endpoint(self.web_hook, endpoint_type)
208
- print(result)
207
+ if result['status'] =="OK":print(f"✔ Set endpoint type to '{endpoint_type}' — Operation succeeded with status: {result['status']}")
208
+ else:print(f"[ERROR] Failed to set endpoint type '{endpoint_type}': Status code {result['status']}")
209
209
  self.web_hook = json_url
210
210
  except Exception as e:
211
211
  logger.error(f"Failed to set webhook from {self.web_hook}: {e}")
@@ -1693,7 +1693,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
1693
1693
  inline_keypad: Optional[Dict[str, Any]] = None,
1694
1694
  disable_notification: bool = False,
1695
1695
  reply_to_message_id: Optional[str] = None,
1696
- chat_keypad_type: Optional[Literal["New", "Removed"]] = None,
1696
+ chat_keypad_type: Optional[Literal["New", "Remove"]] = None,
1697
1697
  delete_after : int = None
1698
1698
  ) -> Dict[str, Any]:
1699
1699
  payload = {
@@ -1857,7 +1857,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
1857
1857
 
1858
1858
  async def close_poll(self, chat_id: str, message_id: str) -> Dict[str, Any]:
1859
1859
  return await self._post("closePoll", {"chat_id": chat_id, "message_id": message_id})
1860
- async def send_location(self, chat_id: str, latitude: str, longitude: str, disable_notification: bool = False, inline_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, chat_keypad_type: Optional[Literal["New", "Removed"]] = None) -> Dict[str, Any]:
1860
+ async def send_location(self, chat_id: str, latitude: str, longitude: str, disable_notification: bool = False, inline_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, chat_keypad_type: Optional[Literal["New", "Remove"]] = None) -> Dict[str, Any]:
1861
1861
  payload = {"chat_id": chat_id, "latitude": latitude, "longitude": longitude, "disable_notification": disable_notification}
1862
1862
  if inline_keypad: payload["inline_keypad"] = inline_keypad
1863
1863
  if reply_to_message_id: payload["reply_to_message_id"] = reply_to_message_id
@@ -1984,7 +1984,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
1984
1984
  raise ValueError(f"Invalid media type. Must be one of {allowed}")
1985
1985
  result = await self._post("requestSendFile", {"type": media_type})
1986
1986
  return result.get("data", {}).get("upload_url")
1987
- async def _send_uploaded_file(self, chat_id: str, file_id: str,type_file : str = "file",text: Optional[str] = None, chat_keypad: Optional[Dict[str, Any]] = None, inline_keypad: Optional[Dict[str, Any]] = None, disable_notification: bool = False, reply_to_message_id: Optional[str] = None, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
1987
+ async def _send_uploaded_file(self, chat_id: str, file_id: str,type_file : str = "file",text: Optional[str] = None, chat_keypad: Optional[Dict[str, Any]] = None, inline_keypad: Optional[Dict[str, Any]] = None, disable_notification: bool = False, reply_to_message_id: Optional[str] = None, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
1988
1988
  payload = {"chat_id": chat_id, "file_id": file_id, "text": text, "disable_notification": disable_notification, "chat_keypad_type": chat_keypad_type}
1989
1989
  if chat_keypad: payload["chat_keypad"] = chat_keypad
1990
1990
  if inline_keypad: payload["inline_keypad"] = inline_keypad
@@ -2016,11 +2016,11 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
2016
2016
  if not file_id:
2017
2017
  raise ValueError("Either path or file_id must be provided.")
2018
2018
  return await self._send_uploaded_file(chat_id=chat_id, file_id=file_id, text=text, inline_keypad=inline_keypad, chat_keypad=chat_keypad, reply_to_message_id=reply_to_message_id, disable_notification=disable_notification, chat_keypad_type=chat_keypad_type,type_file=media_type)
2019
- async def send_document(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
2019
+ async def send_document(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
2020
2020
  return await self._send_file_generic("File", chat_id, path, file_id, text, file_name, inline_keypad, chat_keypad, reply_to_message_id, disable_notification, chat_keypad_type)
2021
- async def send_file(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, caption: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
2021
+ async def send_file(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, caption: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
2022
2022
  return await self._send_file_generic("File", chat_id, path, file_id, caption, file_name, inline_keypad, chat_keypad, reply_to_message_id, disable_notification, chat_keypad_type)
2023
- async def re_send(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, caption: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
2023
+ async def re_send(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, caption: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
2024
2024
  return await self._send_file_generic("File", chat_id, path, file_id, caption, file_name, inline_keypad, chat_keypad, reply_to_message_id, disable_notification, chat_keypad_type)
2025
2025
  async def send_music(
2026
2026
  self,
@@ -2033,7 +2033,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
2033
2033
  chat_keypad: Optional[Dict[str, Any]] = None,
2034
2034
  reply_to_message_id: Optional[str] = None,
2035
2035
  disable_notification: bool = False,
2036
- chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None"
2036
+ chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None"
2037
2037
  ) -> Dict[str, Any]:
2038
2038
  valid_extensions = {"ogg", "oga", "opus", "flac"}
2039
2039
  extension = "flac"
@@ -2078,7 +2078,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
2078
2078
  chat_keypad: Optional[Dict[str, Any]] = None,
2079
2079
  reply_to_message_id: Optional[str] = None,
2080
2080
  disable_notification: bool = False,
2081
- chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None"
2081
+ chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None"
2082
2082
  ) -> Dict[str, Any]:
2083
2083
  valid_extensions = {"gif"}
2084
2084
  extension = "gif"
@@ -2172,7 +2172,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
2172
2172
  async def set_chat_photo(self, chat_id: str, file_id: str) -> Dict[str, Any]:
2173
2173
  return await self._post("editChatPhoto", {"chat_id": chat_id, "file_id": file_id})
2174
2174
  async def remove_chat_photo(self, chat_id: str) -> Dict[str, Any]:
2175
- return await self._post("editChatPhoto", {"chat_id": chat_id, "file_id": "Removed"})
2175
+ return await self._post("editChatPhoto", {"chat_id": chat_id, "file_id": "Remove"})
2176
2176
  async def add_member_chat(self, chat_id: str, user_ids: list[str]) -> Dict[str, Any]:
2177
2177
  return await self._post("addChatMembers", {"chat_id": chat_id, "member_ids": user_ids})
2178
2178
  async def ban_member_chat(self, chat_id: str, user_id: str) -> Dict[str, Any]:
@@ -2221,18 +2221,18 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
2221
2221
  async def update_bot_endpoint(self, url: str, type: str) -> Dict[str, Any]:
2222
2222
  return await self._post("updateBotEndpoints", {"url": url, "type": type})
2223
2223
  async def remove_keypad(self, chat_id: str) -> Dict[str, Any]:
2224
- return await self._post("editChatKeypad", {"chat_id": chat_id, "chat_keypad_type": "Removed"})
2224
+ return await self._post("editChatKeypad", {"chat_id": chat_id, "chat_keypad_type": "Remove"})
2225
2225
  async def edit_chat_keypad(self, chat_id: str, chat_keypad: Dict[str, Any]) -> Dict[str, Any]:
2226
2226
  return await self._post("editChatKeypad", {"chat_id": chat_id, "chat_keypad_type": "New", "chat_keypad": chat_keypad})
2227
2227
  async def send_contact(self, chat_id: str, first_name: str, last_name: str, phone_number: str) -> Dict[str, Any]:
2228
2228
  return await self._post("sendContact", {"chat_id": chat_id, "first_name": first_name, "last_name": last_name, "phone_number": phone_number})
2229
2229
  async def get_chat(self, chat_id: str) -> Dict[str, Any]:
2230
2230
  return await self._post("getChat", {"chat_id": chat_id})
2231
- async def send_video(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
2231
+ async def send_video(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
2232
2232
  return await self._send_file_generic("Video", chat_id, path, file_id, text, file_name, inline_keypad, chat_keypad, reply_to_message_id, disable_notification, chat_keypad_type)
2233
- async def send_voice(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
2233
+ async def send_voice(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
2234
2234
  return await self._send_file_generic("voice", chat_id, path, file_id, text, file_name, inline_keypad, chat_keypad, reply_to_message_id, disable_notification, chat_keypad_type)
2235
- async def send_image(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Removed", "None"]] = "None") -> Dict[str, Any]:
2235
+ async def send_image(self, chat_id: str, path: Optional[Union[str, Path]] = None, file_id: Optional[str] = None, text: Optional[str] = None, file_name: Optional[str] = None, inline_keypad: Optional[Dict[str, Any]] = None, chat_keypad: Optional[Dict[str, Any]] = None, reply_to_message_id: Optional[str] = None, disable_notification: bool = False, chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = "None") -> Dict[str, Any]:
2236
2236
  return await self._send_file_generic("Image", chat_id, path, file_id, text, file_name, inline_keypad, chat_keypad, reply_to_message_id, disable_notification, chat_keypad_type)
2237
2237
  def get_all_member(self, channel_guid: str, search_text: str = None, start_id: str = None, just_get_guids: bool = False):
2238
2238
  client = self._get_client()
rubka/rubino.py CHANGED
@@ -1177,4 +1177,16 @@ class Bot():
1177
1177
  "post_id": post_id,
1178
1178
  "post_profile_id": post_profile_id,
1179
1179
  "profile_id": profile_id
1180
- },methode="addPostViewTime")['data']
1180
+ },methode="addPostViewTime")['data']
1181
+ def get_Profile_Posts(self,target_profile_id:str,max_id:str,sort:str="FromMax",limit:str=10):
1182
+ return self._reuests_post(data={
1183
+ "limit": limit,
1184
+ "max_id": max_id,
1185
+ "sort":sort,
1186
+ "target_profile_id": target_profile_id,
1187
+ },methode="getProfilePosts")['data']
1188
+ def get_info_Post(self,url_post:str,profile_id:str=None):
1189
+ return self._reuests_post(data={
1190
+ "share_string": url_post,
1191
+ "profile_id": profile_id,
1192
+ },methode="getPostByShareLink")['data']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Rubka
3
- Version: 7.1.3
3
+ Version: 7.1.4
4
4
  Summary: rubika A Python library for interacting with Rubika Bot API.
5
5
  Home-page: https://github.com/Mahdy-Ahmadi/Rubka
6
6
  Download-URL: https://github.com/Mahdy-Ahmadi/rubka/archive/refs/tags/v6.6.4.zip
@@ -1,6 +1,6 @@
1
1
  rubka/__init__.py,sha256=P6IBiORfp-GqKHe5LZ-5lldWyG7tnrUYUcAQDUgwXmY,1973
2
2
  rubka/api.py,sha256=fo4X9MH_HqQmLkRNhjJcJJZOHp5lkFZqitCXs2qL_kc,68891
3
- rubka/asynco.py,sha256=84qCDieEngvNWBZwFgv-Cu7w8Emvkjru7AUjhswuHcQ,108098
3
+ rubka/asynco.py,sha256=QIwWgfhmKqNeqkO0VxpoLCmNBKVM58GP8JdpuvgCzL8,108338
4
4
  rubka/button.py,sha256=woSzZVd5MtTqOrP-YgkH5b0GS9y4DuKBsFSc9-KuLnk,13320
5
5
  rubka/config.py,sha256=Bck59xkOiqioLv0GkQ1qPGnBXVctz1hKk6LT4h2EPx0,78
6
6
  rubka/context.py,sha256=-oC9h7U_H3CrtqUCDCnFXAvC7zdSmwxlc0CNwL1XLxM,34314
@@ -12,7 +12,7 @@ rubka/jobs.py,sha256=GvLMLsVhcSEzRTgkvnPISPEBN71suW2xXI0hUaUZPTo,378
12
12
  rubka/keyboards.py,sha256=7nr-dT2bQJVQnQ6RMWPTSjML6EEk6dsBx-4d8pab8xk,488
13
13
  rubka/keypad.py,sha256=yGsNt8W5HtUFBzVF1m_p7GySlu1hwIcSvXZ4BTdrlvg,9558
14
14
  rubka/logger.py,sha256=J2I6NiK1z32lrAzC4H1Et6WPMBXxXGCVUsW4jgcAofs,289
15
- rubka/rubino.py,sha256=1vr3lxKWkZ6len8niyB3b92vUR-uaui71vBoydBq52A,60093
15
+ rubka/rubino.py,sha256=d_j32FVra8HLsZ-QJC-clChJZK6VFLqgLFAFSr-jRFk,60651
16
16
  rubka/tv.py,sha256=rBoyCadCH3I3YqQGrQYv_dLtTg1I63AzVf1orn-hbko,5724
17
17
  rubka/update.py,sha256=-oC9h7U_H3CrtqUCDCnFXAvC7zdSmwxlc0CNwL1XLxM,34314
18
18
  rubka/utils.py,sha256=XUQUZxQt9J2f0X5hmAH_MH1kibTAfdT1T4AaBkBhBBs,148
@@ -37,8 +37,8 @@ rubka/adaptorrubka/types/socket/message.py,sha256=0WgLMZh4eow8Zn7AiSX4C3GZjQTkIg
37
37
  rubka/adaptorrubka/utils/__init__.py,sha256=OgCFkXdNFh379quNwIVOAWY2NP5cIOxU5gDRRALTk4o,54
38
38
  rubka/adaptorrubka/utils/configs.py,sha256=nMUEOJh1NqDJsf9W9PurkN_DLYjO6kKPMm923i4Jj_A,492
39
39
  rubka/adaptorrubka/utils/utils.py,sha256=5-LioLNYX_TIbQGDeT50j7Sg9nAWH2LJUUs-iEXpsUY,8816
40
- rubka-7.1.3.dist-info/METADATA,sha256=5mARCboZgBx0tMY1O9-ovDFxusr9zpgFNZQBH8SXong,34291
41
- rubka-7.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
- rubka-7.1.3.dist-info/entry_points.txt,sha256=4aESuUmuUOALMUy7Kucv_Gb5YlqhsJmTmdXLlZU9sJ0,46
43
- rubka-7.1.3.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
44
- rubka-7.1.3.dist-info/RECORD,,
40
+ rubka-7.1.4.dist-info/METADATA,sha256=mkANXgvGnSdKVFOHBJ7cXCVEs7W5aoOZopYA4RmiU5A,34291
41
+ rubka-7.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
+ rubka-7.1.4.dist-info/entry_points.txt,sha256=4aESuUmuUOALMUy7Kucv_Gb5YlqhsJmTmdXLlZU9sJ0,46
43
+ rubka-7.1.4.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
44
+ rubka-7.1.4.dist-info/RECORD,,
File without changes