Rubka 7.1.5__tar.gz → 7.1.6__tar.gz

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 (50) hide show
  1. {rubka-7.1.5 → rubka-7.1.6}/PKG-INFO +1 -1
  2. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/PKG-INFO +1 -1
  3. {rubka-7.1.5 → rubka-7.1.6}/rubka/asynco.py +7 -2
  4. {rubka-7.1.5 → rubka-7.1.6}/rubka/rubino.py +19 -7
  5. {rubka-7.1.5 → rubka-7.1.6}/setup.py +1 -1
  6. {rubka-7.1.5 → rubka-7.1.6}/README.md +0 -0
  7. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/SOURCES.txt +0 -0
  8. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/dependency_links.txt +0 -0
  9. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/entry_points.txt +0 -0
  10. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/not-zip-safe +0 -0
  11. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/requires.txt +0 -0
  12. {rubka-7.1.5 → rubka-7.1.6}/Rubka.egg-info/top_level.txt +0 -0
  13. {rubka-7.1.5 → rubka-7.1.6}/rubka/__init__.py +0 -0
  14. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/__init__.py +0 -0
  15. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/client/__init__.py +0 -0
  16. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/client/client.py +0 -0
  17. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/crypto/__init__.py +0 -0
  18. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/crypto/crypto.py +0 -0
  19. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/enums.py +0 -0
  20. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/exceptions.py +0 -0
  21. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/methods/__init__.py +0 -0
  22. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/methods/methods.py +0 -0
  23. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/network/__init__.py +0 -0
  24. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/network/helper.py +0 -0
  25. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/network/network.py +0 -0
  26. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/network/socket.py +0 -0
  27. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/sessions/__init__.py +0 -0
  28. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/sessions/sessions.py +0 -0
  29. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/types/__init__.py +0 -0
  30. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/types/socket/__init__.py +0 -0
  31. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/types/socket/message.py +0 -0
  32. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/utils/__init__.py +0 -0
  33. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/utils/configs.py +0 -0
  34. {rubka-7.1.5 → rubka-7.1.6}/rubka/adaptorrubka/utils/utils.py +0 -0
  35. {rubka-7.1.5 → rubka-7.1.6}/rubka/api.py +0 -0
  36. {rubka-7.1.5 → rubka-7.1.6}/rubka/button.py +0 -0
  37. {rubka-7.1.5 → rubka-7.1.6}/rubka/config.py +0 -0
  38. {rubka-7.1.5 → rubka-7.1.6}/rubka/context.py +0 -0
  39. {rubka-7.1.5 → rubka-7.1.6}/rubka/decorators.py +0 -0
  40. {rubka-7.1.5 → rubka-7.1.6}/rubka/exceptions.py +0 -0
  41. {rubka-7.1.5 → rubka-7.1.6}/rubka/filters.py +0 -0
  42. {rubka-7.1.5 → rubka-7.1.6}/rubka/helpers.py +0 -0
  43. {rubka-7.1.5 → rubka-7.1.6}/rubka/jobs.py +0 -0
  44. {rubka-7.1.5 → rubka-7.1.6}/rubka/keyboards.py +0 -0
  45. {rubka-7.1.5 → rubka-7.1.6}/rubka/keypad.py +0 -0
  46. {rubka-7.1.5 → rubka-7.1.6}/rubka/logger.py +0 -0
  47. {rubka-7.1.5 → rubka-7.1.6}/rubka/tv.py +0 -0
  48. {rubka-7.1.5 → rubka-7.1.6}/rubka/update.py +0 -0
  49. {rubka-7.1.5 → rubka-7.1.6}/rubka/utils.py +0 -0
  50. {rubka-7.1.5 → rubka-7.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Rubka
3
- Version: 7.1.5
3
+ Version: 7.1.6
4
4
  Summary: Rubika: A Python library for interacting with the Rubika Bot API. This library provides an easy-to-use interface to send messages, polls, stickers, media files, manage groups and channels, handle inline keyboards, and implement advanced bot features like subscription management, user authentication, and message handling. Ideal for developers looking to automate and extend their Rubika bots with Python.
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
  Metadata-Version: 2.4
2
2
  Name: Rubka
3
- Version: 7.1.5
3
+ Version: 7.1.6
4
4
  Summary: Rubika: A Python library for interacting with the Rubika Bot API. This library provides an easy-to-use interface to send messages, polls, stickers, media files, manage groups and channels, handle inline keyboards, and implement advanced bot features like subscription management, user authentication, and message handling. Ideal for developers looking to automate and extend their Rubika bots with Python.
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
@@ -1054,7 +1054,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
1054
1054
  self._processed_message_ids.popitem(last=False)
1055
1055
  return False
1056
1056
 
1057
- async def run(
1057
+ async def run_progelry(
1058
1058
  self,
1059
1059
  debug: bool = False,
1060
1060
  sleep_time: float = 0.1,
@@ -1414,7 +1414,7 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
1414
1414
  await check_rubka_version()
1415
1415
  await self._initialize_webhook()
1416
1416
  await self.geteToken()
1417
- _log("Bot started running...", "info")
1417
+ _log("Bot is up and running...", "info")
1418
1418
 
1419
1419
  try:
1420
1420
  while True:
@@ -1641,6 +1641,11 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
1641
1641
 
1642
1642
 
1643
1643
  _log("Auto-restart requested. You can call run(...) again as needed.", "warning")
1644
+ def run(self, sleep_time : float = 0.1 ,*args, **kwargs):
1645
+ print("Connecting to the server...")
1646
+ loop = asyncio.get_event_loop()
1647
+ if loop.is_running():return loop.create_task(self.run_progelry(sleep_time=sleep_time,*args, **kwargs))
1648
+ else:return asyncio.run(self.run_progelry(sleep_time=sleep_time,*args, **kwargs))
1644
1649
  async def _delete_after_task(self, chat_id: str, message_id: str, delay: int):
1645
1650
  try:
1646
1651
  await asyncio.sleep(delay)
@@ -5,6 +5,10 @@ from tempfile import NamedTemporaryFile
5
5
  from os import system, chmod, remove
6
6
  from base64 import b64encode
7
7
  from io import BytesIO
8
+ class InvalidInputError(Exception):
9
+ def __init__(self, message="Invalid input provided"):
10
+ self.message = message
11
+ super().__init__(self.message)
8
12
  class confing():
9
13
  headers= {
10
14
  "User-Agent": "okhttp/3.12.1",
@@ -192,9 +196,15 @@ class req:
192
196
  except:
193
197
  continue
194
198
  else:
195
- if 'data_enc' in response.json():
196
- return loads(self.enc.decrypt(response.json()['data_enc']))
197
- return response.json()
199
+
200
+ response_data = response.json()
201
+
202
+ if 'data_enc' in response_data:
203
+ return loads(self.enc.decrypt(response_data['data_enc']))
204
+ if response_data.get('status') != "OK":
205
+ raise InvalidInputError(f"Error : {response_data.get('status_det', 'Unknown error')}")
206
+ return response_data
207
+
198
208
 
199
209
  def requestUploadFile(self,file_name:str,size:str,file_type:str,profile_id:str=None):
200
210
  return self.send_request({
@@ -203,6 +213,7 @@ class req:
203
213
  "file_type": file_type,
204
214
  "profile_id": profile_id
205
215
  },"requestUploadFile")
216
+
206
217
 
207
218
  def upload(self, post_file, post_type: str, profile_id: str = None):
208
219
  file_byte_code = post_file if isinstance(post_file, bytes) else open(post_file, "rb").read()
@@ -476,11 +487,12 @@ class Bot():
476
487
  if response.status == 200:
477
488
  response_data = json.loads(response.data.decode('utf-8'))
478
489
  if 'data' in response_data:
479
- return response_data['data']
490
+ return response_data['data']
480
491
  else:
481
- return response_data['status_det']
482
- else :
483
- raise Exception("Request Error Server")
492
+ raise Exception(f"Error: {response_data.get('status_det', 'Unknown error')}")
493
+ else:
494
+ raise Exception(f"Request Error Server - Status Code: {response.status}")
495
+
484
496
  def edit_info_page(
485
497
  self,
486
498
  username_me:str,
@@ -13,7 +13,7 @@ with open("README.md", "r", encoding="utf-8") as f:
13
13
 
14
14
  setup(
15
15
  name='Rubka',
16
- version='7.1.5',
16
+ version='7.1.6',
17
17
  description=(
18
18
  "Rubika: A Python library for interacting with the Rubika Bot API. "
19
19
  "This library provides an easy-to-use interface to send messages, polls, "
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes