Rubka 4.4.19__py3-none-any.whl → 4.4.20__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.
rubka/api.py CHANGED
@@ -115,11 +115,23 @@ class Robot:
115
115
  self._inline_query_handler = None
116
116
  self._callback_handlers = None
117
117
  self._callback_handlers = [] # ✅ این خط مهمه
118
- json_url = requests.get(web_hook).json()['url']
119
118
  if web_hook:
120
- for endpoint_type in ["ReceiveUpdate", "ReceiveInlineMessage", "ReceiveQuery", "GetSelectionItem", "SearchSelectionItems"]:
121
- print(self.update_bot_endpoint(web_hook, endpoint_type))
122
- self.web_hook = json_url
119
+ try:
120
+ json_url = requests.get(web_hook, timeout=self.timeout).json().get('url', web_hook)
121
+ for endpoint_type in [
122
+ "ReceiveUpdate",
123
+ "ReceiveInlineMessage",
124
+ "ReceiveQuery",
125
+ "GetSelectionItem",
126
+ "SearchSelectionItems"
127
+ ]:
128
+ print(self.update_bot_endpoint(self.web_hook, endpoint_type))
129
+ self.web_hook = json_url
130
+ except Exception as e:
131
+ logger.error(f"Failed to set webhook from {web_hook}: {e}")
132
+ else:
133
+ self.web_hook = None
134
+
123
135
 
124
136
 
125
137
  logger.info(f"Initialized RubikaBot with token: {token[:8]}***")
@@ -366,15 +378,6 @@ class Robot:
366
378
 
367
379
  except Exception as e:
368
380
  print(f"❌ Error in run loop: {e}")
369
-
370
-
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
381
  def send_message(
379
382
  self,
380
383
  chat_id: str,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Rubka
3
- Version: 4.4.19
3
+ Version: 4.4.20
4
4
  Summary: 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/blob/main/project_library.zip
@@ -1,5 +1,5 @@
1
1
  rubka/__init__.py,sha256=TR1DABU5Maz2eO62ZEFiwOqNU0dH6l6HZfqRUxeo4eY,194
2
- rubka/api.py,sha256=h818Eoi84-odyf2Ed1H_suL8VSAHCN-TYM1Jaww2LD4,32370
2
+ rubka/api.py,sha256=NICbYs-4hpnsypGaJeDZ0xoBiuvLV0whSkak9sxM_Bw,32719
3
3
  rubka/button.py,sha256=4fMSZR7vUADxSmw1R3_pZ4dw5uMLZX5sOkwPPyNTBDE,8437
4
4
  rubka/config.py,sha256=Bck59xkOiqioLv0GkQ1qPGnBXVctz1hKk6LT4h2EPx0,78
5
5
  rubka/context.py,sha256=j1scXTy_wBY52MmMixfZyIQnB0sdYjRwx17-8ZZmyB4,17017
@@ -32,7 +32,7 @@ rubka/adaptorrubka/types/socket/message.py,sha256=0WgLMZh4eow8Zn7AiSX4C3GZjQTkIg
32
32
  rubka/adaptorrubka/utils/__init__.py,sha256=OgCFkXdNFh379quNwIVOAWY2NP5cIOxU5gDRRALTk4o,54
33
33
  rubka/adaptorrubka/utils/configs.py,sha256=nMUEOJh1NqDJsf9W9PurkN_DLYjO6kKPMm923i4Jj_A,492
34
34
  rubka/adaptorrubka/utils/utils.py,sha256=5-LioLNYX_TIbQGDeT50j7Sg9nAWH2LJUUs-iEXpsUY,8816
35
- rubka-4.4.19.dist-info/METADATA,sha256=HUXTIlzStSyrHVnjRxFCByBBrZd6TH8RpFYa9_tpe_s,33217
36
- rubka-4.4.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- rubka-4.4.19.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
38
- rubka-4.4.19.dist-info/RECORD,,
35
+ rubka-4.4.20.dist-info/METADATA,sha256=zVVTaP_jxIAlAD1TyHLWyJjv6y138FScv3g104EBPHo,33217
36
+ rubka-4.4.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ rubka-4.4.20.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
38
+ rubka-4.4.20.dist-info/RECORD,,
File without changes