Rubka 7.1.5__py3-none-any.whl → 7.1.7__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/asynco.py +34 -29
- rubka/rubino.py +145 -106
- {rubka-7.1.5.dist-info → rubka-7.1.7.dist-info}/METADATA +1 -1
- {rubka-7.1.5.dist-info → rubka-7.1.7.dist-info}/RECORD +7 -7
- {rubka-7.1.5.dist-info → rubka-7.1.7.dist-info}/WHEEL +0 -0
- {rubka-7.1.5.dist-info → rubka-7.1.7.dist-info}/entry_points.txt +0 -0
- {rubka-7.1.5.dist-info → rubka-7.1.7.dist-info}/top_level.txt +0 -0
rubka/asynco.py
CHANGED
|
@@ -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
|
|
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
|
|
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)
|
|
@@ -2231,8 +2236,8 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
|
|
|
2231
2236
|
return await self._post("editChatKeypad", {"chat_id": chat_id, "chat_keypad_type": "Remove"})
|
|
2232
2237
|
async def edit_chat_keypad(self, chat_id: str, chat_keypad: Dict[str, Any]) -> Dict[str, Any]:
|
|
2233
2238
|
return await self._post("editChatKeypad", {"chat_id": chat_id, "chat_keypad_type": "New", "chat_keypad": chat_keypad})
|
|
2234
|
-
async def send_contact(self, chat_id: str, first_name: str, last_name: str, phone_number: str) -> Dict[str, Any]:
|
|
2235
|
-
return await self._post("sendContact", {"chat_id": chat_id, "first_name": first_name, "last_name": last_name, "phone_number": phone_number})
|
|
2239
|
+
async def send_contact(self, chat_id: str, first_name: str, last_name: str, phone_number: str,inline_keypad: Optional[Dict[str, Any]] = None,chat_keypad: Optional[Dict[str, Any]] = None,chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = None,) -> Dict[str, Any]:
|
|
2240
|
+
return await self._post("sendContact", {"chat_id": chat_id, "first_name": first_name, "last_name": last_name, "phone_number": phone_number,"inline_keypad": inline_keypad,"chat_keypad": chat_keypad,"chat_keypad_type": chat_keypad_type})
|
|
2236
2241
|
async def get_chat(self, chat_id: str) -> Dict[str, Any]:
|
|
2237
2242
|
return await self._post("getChat", {"chat_id": chat_id})
|
|
2238
2243
|
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]:
|
|
@@ -2256,42 +2261,42 @@ max_cache_size and max_msg_age help manage duplicate message processing efficien
|
|
|
2256
2261
|
hint: Optional[str] = None,
|
|
2257
2262
|
reply_to_message_id: Optional[str] = None,
|
|
2258
2263
|
disable_notification: bool = False,
|
|
2259
|
-
|
|
2260
|
-
inline_keypad : Optional[Dict[str, Any]] = None,
|
|
2264
|
+
inline_keypad: Optional[Dict[str, Any]] = None,
|
|
2261
2265
|
chat_keypad: Optional[Dict[str, Any]] = None,
|
|
2262
2266
|
chat_keypad_type: Optional[Literal["New", "Remove", "None"]] = None,
|
|
2263
|
-
|
|
2264
2267
|
) -> AttrDict:
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
)
|
|
2268
|
+
|
|
2269
|
+
payload = {
|
|
2270
|
+
"chat_id": chat_id,
|
|
2271
|
+
"question": question,
|
|
2272
|
+
"options": options,
|
|
2273
|
+
"type": type,
|
|
2274
|
+
"allows_multiple_answers": allows_multiple_answers,
|
|
2275
|
+
"is_anonymous": is_anonymous,
|
|
2276
|
+
"correct_option_index": correct_option_index,
|
|
2277
|
+
"explanation": hint,
|
|
2278
|
+
"reply_to_message_id": reply_to_message_id,
|
|
2279
|
+
"disable_notification": disable_notification,
|
|
2280
|
+
"inline_keypad": inline_keypad,
|
|
2281
|
+
"chat_keypad": chat_keypad,
|
|
2282
|
+
"chat_keypad_type": chat_keypad_type,
|
|
2283
|
+
}
|
|
2284
|
+
payload = {k: v for k, v in payload.items() if v is not None or (k in ["is_anonymous", "disable_notification"] and v is False)}
|
|
2285
|
+
return await self._post("sendPoll", payload)
|
|
2286
|
+
|
|
2283
2287
|
async def check_join(self, channel_guid: str, chat_id: str = None) -> Union[bool, list[str]]:
|
|
2284
2288
|
client = self._get_client()
|
|
2285
2289
|
if chat_id:
|
|
2286
2290
|
chat_info_data = await self.get_chat(chat_id)
|
|
2287
2291
|
chat_info = chat_info_data.get('data', {}).get('chat', {})
|
|
2288
2292
|
username = chat_info.get('username')
|
|
2289
|
-
|
|
2293
|
+
first_name = chat_info.get("first_name", "")
|
|
2290
2294
|
if username:
|
|
2291
2295
|
result = await asyncio.to_thread(self.get_all_member, channel_guid, search_text=username)
|
|
2292
2296
|
members = result.get('in_chat_members', [])
|
|
2293
2297
|
return any(m.get('username') == username for m in members)
|
|
2294
|
-
elif
|
|
2295
|
-
|
|
2296
|
-
|
|
2298
|
+
elif first_name:
|
|
2299
|
+
result = await asyncio.to_thread(self.get_all_member, channel_guid, search_text=first_name)
|
|
2300
|
+
members = result.get('in_chat_members', [])
|
|
2301
|
+
return any(m.get('first_name') == first_name for m in members)
|
|
2297
2302
|
return False
|
rubka/rubino.py
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import urllib3
|
|
2
|
-
import json
|
|
3
|
-
from typing import Any, Dict
|
|
2
|
+
import json,random
|
|
3
|
+
from typing import Any, Dict,List
|
|
4
4
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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()
|
|
@@ -406,24 +417,7 @@ class api:
|
|
|
406
417
|
response_data = json.loads(response.data.decode('utf-8'))
|
|
407
418
|
if 'result' in response_data:
|
|
408
419
|
return response_data['result']
|
|
409
|
-
|
|
410
|
-
resp = get(
|
|
411
|
-
url="https://www.google.com/search",
|
|
412
|
-
headers={
|
|
413
|
-
"User-Agent": get_useragent()
|
|
414
|
-
},
|
|
415
|
-
params={
|
|
416
|
-
"q": term,
|
|
417
|
-
"num": results + 2, # Prevents multiple requests
|
|
418
|
-
"hl": lang,
|
|
419
|
-
"start": start,
|
|
420
|
-
},
|
|
421
|
-
proxies=proxies,
|
|
422
|
-
timeout=timeout,
|
|
423
|
-
)
|
|
424
|
-
resp.raise_for_status()
|
|
425
|
-
return resp
|
|
426
|
-
import random
|
|
420
|
+
|
|
427
421
|
|
|
428
422
|
class Bot():
|
|
429
423
|
"""rubino class Regester m.rubika.ir"""
|
|
@@ -476,11 +470,12 @@ class Bot():
|
|
|
476
470
|
if response.status == 200:
|
|
477
471
|
response_data = json.loads(response.data.decode('utf-8'))
|
|
478
472
|
if 'data' in response_data:
|
|
479
|
-
|
|
473
|
+
return response_data['data']
|
|
480
474
|
else:
|
|
481
|
-
|
|
482
|
-
else
|
|
483
|
-
raise Exception("Request Error Server")
|
|
475
|
+
raise Exception(f"Error: {response_data.get('status_det', 'Unknown error')}")
|
|
476
|
+
else:
|
|
477
|
+
raise Exception(f"Request Error Server - Status Code: {response.status}")
|
|
478
|
+
|
|
484
479
|
def edit_info_page(
|
|
485
480
|
self,
|
|
486
481
|
username_me:str,
|
|
@@ -663,6 +658,49 @@ class Bot():
|
|
|
663
658
|
return [668,789]
|
|
664
659
|
except Exception as e:
|
|
665
660
|
return [668,789]
|
|
661
|
+
def add_Story(self,post_file:str,duration:int=27,size:list=[668,798],thumbnail_file:str=None,profile_id:str=None):
|
|
662
|
+
|
|
663
|
+
if post_file.split(".")[-1] == "mp4" or post_file.split(".")[-1] == "mov" or post_file.split(".")[-1] == "mkv" or "https://":
|
|
664
|
+
try:
|
|
665
|
+
if "https://" in post_file:
|
|
666
|
+
tumb_res , post_res = req(self.auth).upload(image_to_bytes(thumbnail_file) if type(thumbnail_file) is str else confing.th,"Picture",profile_id) , req(self.auth).upload(requests.get(post_file).content,"Video",profile_id)
|
|
667
|
+
else :
|
|
668
|
+
tumb_res , post_res = req(self.auth).upload(image_to_bytes(thumbnail_file) if type(thumbnail_file) is str else confing.th,"Picture",profile_id) , req(self.auth).upload(post_file,"Video",profile_id)
|
|
669
|
+
except ModuleNotFoundError:
|
|
670
|
+
print("pip install moviepy")
|
|
671
|
+
tumb_res , post_res = req(self.auth).upload(confing.th,"Picture",profile_id) , req(self.auth).upload(post_file,"Video",profile_id)
|
|
672
|
+
data = {
|
|
673
|
+
"duration": str(duration),
|
|
674
|
+
"file_id": post_res[0]["file_id"],
|
|
675
|
+
"hash_file_receive": post_res[1],
|
|
676
|
+
"height": 1280 if size[1] > 1280 else size[1],
|
|
677
|
+
"story_type": "Video",
|
|
678
|
+
"rnd": random.randint(100000, 999999999),
|
|
679
|
+
"snapshot_file_id": tumb_res[0]["file_id"],
|
|
680
|
+
"snapshot_hash_file_receive": tumb_res[1],
|
|
681
|
+
"thumbnail_file_id": tumb_res[0]["file_id"],
|
|
682
|
+
"thumbnail_hash_file_receive": tumb_res[1],
|
|
683
|
+
"width": 720 if size[0] > 720 else size[0],
|
|
684
|
+
"profile_id": profile_id
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
elif post_file.split(".")[-1] == "jpg" or post_file.split(".")[-1] == "png":
|
|
688
|
+
post_res = req(self.auth).upload(post_file,"Picture",profile_id)
|
|
689
|
+
|
|
690
|
+
data = {
|
|
691
|
+
"file_id": post_res[0]["file_id"],
|
|
692
|
+
"hash_file_receive": post_res[1],
|
|
693
|
+
"height": 1280 if size[1] > 1280 else size[1],
|
|
694
|
+
"story_type": "Picture",
|
|
695
|
+
"rnd": random.randint(100000, 999999999),
|
|
696
|
+
"thumbnail_file_id": post_res[0]["file_id"],
|
|
697
|
+
"thumbnail_hash_file_receive": post_res[1],
|
|
698
|
+
"width": 720 if size[0] > 720 else size[0],
|
|
699
|
+
"profile_id": profile_id
|
|
700
|
+
}
|
|
701
|
+
else:
|
|
702
|
+
return "file address eror"
|
|
703
|
+
return req(self.auth).send_request(data,"addStory")['data']
|
|
666
704
|
def add_Post(self,post_file: str, caption: str = None, time: int = 1, size: Any = [668, 798], thumbnail_file: str = None, profile_id: str = None):
|
|
667
705
|
from concurrent.futures import ThreadPoolExecutor
|
|
668
706
|
if size == "Auto" or size =="auto":
|
|
@@ -968,28 +1006,6 @@ class Bot():
|
|
|
968
1006
|
"target_profile_id": target_profile_id,
|
|
969
1007
|
"story_ids":story_ids
|
|
970
1008
|
},methode="getHighlightStories")
|
|
971
|
-
|
|
972
|
-
def get_NewFollow_Requests(self,sort:str="FromMax",limit:int=50,equal:bool=False,profile_id:str=None):
|
|
973
|
-
return self._reuests_post(data={
|
|
974
|
-
"equal": equal,
|
|
975
|
-
"limit": limit,
|
|
976
|
-
"sort": sort,
|
|
977
|
-
"profile_id": profile_id
|
|
978
|
-
},methode="getNewFollowRequests")
|
|
979
|
-
|
|
980
|
-
def accept_Request_Follow(self,request_id:str,profile_id:str=None):
|
|
981
|
-
return self._reuests_post(data={
|
|
982
|
-
"action": "Accept",
|
|
983
|
-
"request_id": request_id,
|
|
984
|
-
"profile_id": profile_id
|
|
985
|
-
},methode="actionOnRequest")
|
|
986
|
-
|
|
987
|
-
def decline_Request_Follow(self,request_id:str,profile_id:str=None):
|
|
988
|
-
return self._reuests_post(data={
|
|
989
|
-
"action": "Decline",
|
|
990
|
-
"request_id": request_id,
|
|
991
|
-
"profile_id": profile_id
|
|
992
|
-
},methode="actionOnRequest")
|
|
993
1009
|
def un_save_Post(self,post_profile_id:str,post_id:str,profile_id:str=None):
|
|
994
1010
|
return self._reuests_post(data={
|
|
995
1011
|
"action_type": "Unbookmark",
|
|
@@ -1004,24 +1020,11 @@ class Bot():
|
|
|
1004
1020
|
limit: int = 20,
|
|
1005
1021
|
profile_id: Optional[str] = None,
|
|
1006
1022
|
sort: str = "FromMax") -> Dict[str, Any]:
|
|
1007
|
-
"""
|
|
1008
|
-
دریافت پستهای ذخیرهشده (بوکمارکشده)
|
|
1009
|
-
|
|
1010
|
-
Args:
|
|
1011
|
-
max_id (str): شناسه آخرین پست برای صفحهبندی.
|
|
1012
|
-
limit (int, optional): تعداد پستها در هر درخواست. پیشفرض 20.
|
|
1013
|
-
profile_id (str, optional): شناسه پروفایل (در صورت نیاز).
|
|
1014
|
-
sort (str, optional): نوع مرتبسازی. پیشفرض "FromMax".
|
|
1015
|
-
|
|
1016
|
-
Returns:
|
|
1017
|
-
Dict[str, Any]: پاسخ سرور شامل لیست پستهای ذخیرهشده.
|
|
1018
|
-
"""
|
|
1019
1023
|
payload = {
|
|
1020
1024
|
"limit": limit,
|
|
1021
1025
|
"max_id": max_id,
|
|
1022
1026
|
"sort": sort
|
|
1023
1027
|
}
|
|
1024
|
-
|
|
1025
1028
|
if profile_id is not None:
|
|
1026
1029
|
payload["profile_id"] = profile_id
|
|
1027
1030
|
|
|
@@ -1115,49 +1118,7 @@ class Bot():
|
|
|
1115
1118
|
"thumbnail_hash_file_receive": prof_res[1],
|
|
1116
1119
|
"profile_id": profile_id
|
|
1117
1120
|
},methode="updateProfilePhoto")
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
if post_file.split(".")[-1] == "mp4" or post_file.split(".")[-1] == "mov" or post_file.split(".")[-1] == "mkv" or "https://":
|
|
1121
|
-
try:
|
|
1122
|
-
if "https://" in post_file:
|
|
1123
|
-
tumb_res , post_res = req(self.auth).upload(image_to_bytes(thumbnail_file) if type(thumbnail_file) is str else confing.th,"Picture",profile_id) , req(self.auth).upload(requests.get(post_file).content,"Video",profile_id)
|
|
1124
|
-
else :
|
|
1125
|
-
tumb_res , post_res = req(self.auth).upload(image_to_bytes(thumbnail_file) if type(thumbnail_file) is str else confing.th,"Picture",profile_id) , req(self.auth).upload(post_file,"Video",profile_id)
|
|
1126
|
-
except ModuleNotFoundError:
|
|
1127
|
-
print("pip install moviepy")
|
|
1128
|
-
tumb_res , post_res = req(self.auth).upload(confing.th,"Picture",profile_id) , req(self.auth).upload(post_file,"Video",profile_id)
|
|
1129
|
-
data = {
|
|
1130
|
-
"duration": str(duration),
|
|
1131
|
-
"file_id": post_res[0]["file_id"],
|
|
1132
|
-
"hash_file_receive": post_res[1],
|
|
1133
|
-
"height": 1280 if size[1] > 1280 else size[1],
|
|
1134
|
-
"story_type": "Video",
|
|
1135
|
-
"rnd": random.randint(100000, 999999999),
|
|
1136
|
-
"snapshot_file_id": tumb_res[0]["file_id"],
|
|
1137
|
-
"snapshot_hash_file_receive": tumb_res[1],
|
|
1138
|
-
"thumbnail_file_id": tumb_res[0]["file_id"],
|
|
1139
|
-
"thumbnail_hash_file_receive": tumb_res[1],
|
|
1140
|
-
"width": 720 if size[0] > 720 else size[0],
|
|
1141
|
-
"profile_id": profile_id
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
elif post_file.split(".")[-1] == "jpg" or post_file.split(".")[-1] == "png":
|
|
1145
|
-
post_res = req(self.auth).upload(post_file,"Picture",profile_id)
|
|
1146
|
-
|
|
1147
|
-
data = {
|
|
1148
|
-
"file_id": post_res[0]["file_id"],
|
|
1149
|
-
"hash_file_receive": post_res[1],
|
|
1150
|
-
"height": 1280 if size[1] > 1280 else size[1],
|
|
1151
|
-
"story_type": "Picture",
|
|
1152
|
-
"rnd": random.randint(100000, 999999999),
|
|
1153
|
-
"thumbnail_file_id": post_res[0]["file_id"],
|
|
1154
|
-
"thumbnail_hash_file_receive": post_res[1],
|
|
1155
|
-
"width": 720 if size[0] > 720 else size[0],
|
|
1156
|
-
"profile_id": profile_id
|
|
1157
|
-
}
|
|
1158
|
-
else:
|
|
1159
|
-
return "file address eror"
|
|
1160
|
-
return req(self.auth).send_request(data,"addStory")['data']
|
|
1121
|
+
|
|
1161
1122
|
def delete_Page(self,page_profile_id:str):
|
|
1162
1123
|
return self._reuests_post(data={
|
|
1163
1124
|
"model": "Profile",
|
|
@@ -1189,4 +1150,82 @@ class Bot():
|
|
|
1189
1150
|
return self._reuests_post(data={
|
|
1190
1151
|
"share_string": url_post,
|
|
1191
1152
|
"profile_id": profile_id,
|
|
1192
|
-
},methode="getPostByShareLink")['data']
|
|
1153
|
+
},methode="getPostByShareLink")['data']
|
|
1154
|
+
def search_HashTag(
|
|
1155
|
+
self,
|
|
1156
|
+
content: str,
|
|
1157
|
+
profile_id:str,
|
|
1158
|
+
limit: int = 20,
|
|
1159
|
+
) -> Dict[str, Any]:
|
|
1160
|
+
|
|
1161
|
+
payload = {
|
|
1162
|
+
"profile_id": profile_id,
|
|
1163
|
+
"content": content,
|
|
1164
|
+
"limit": limit
|
|
1165
|
+
}
|
|
1166
|
+
return self._reuests_post("reportProfile", data=payload)
|
|
1167
|
+
def accept_Follow_Request(
|
|
1168
|
+
self,
|
|
1169
|
+
request_id: str,
|
|
1170
|
+
profile_id: Optional[str] = None
|
|
1171
|
+
) -> Dict[str, Any]:
|
|
1172
|
+
"""
|
|
1173
|
+
Accept a follow request from a user.
|
|
1174
|
+
|
|
1175
|
+
Args:
|
|
1176
|
+
request_id (str): The ID of the follow request.
|
|
1177
|
+
profile_id (Optional[str]): The profile ID of the current user (if available).
|
|
1178
|
+
|
|
1179
|
+
Returns:
|
|
1180
|
+
Dict[str, Any]: The server's response, including action status.
|
|
1181
|
+
"""
|
|
1182
|
+
payload = {
|
|
1183
|
+
"action": "Accept",
|
|
1184
|
+
"request_id": request_id,
|
|
1185
|
+
"profile_id": profile_id
|
|
1186
|
+
}
|
|
1187
|
+
return self._reuests_post("actionOnRequest", data=payload)
|
|
1188
|
+
def decline_Follow_Request(
|
|
1189
|
+
self,
|
|
1190
|
+
request_id: str,
|
|
1191
|
+
profile_id: Optional[str] = None
|
|
1192
|
+
) -> Dict[str, Any]:
|
|
1193
|
+
"""
|
|
1194
|
+
Decline a follow request from a user.
|
|
1195
|
+
|
|
1196
|
+
Args:
|
|
1197
|
+
request_id (str): The ID of the follow request.
|
|
1198
|
+
profile_id (Optional[str]): The profile ID of the current user (if available).
|
|
1199
|
+
|
|
1200
|
+
Returns:
|
|
1201
|
+
Dict[str, Any]: The server's response, including action status.
|
|
1202
|
+
"""
|
|
1203
|
+
payload = {
|
|
1204
|
+
"action": "Decline",
|
|
1205
|
+
"request_id": request_id,
|
|
1206
|
+
"profile_id": profile_id
|
|
1207
|
+
}
|
|
1208
|
+
return self._reuests_post("actionOnRequest", data=payload)
|
|
1209
|
+
def get_New_Follow_Requests(
|
|
1210
|
+
self,
|
|
1211
|
+
profile_id: Optional[str] = None ,
|
|
1212
|
+
limit: int = 20,
|
|
1213
|
+
sort: str = "FromMax"
|
|
1214
|
+
) -> Dict[str, Any]:
|
|
1215
|
+
"""
|
|
1216
|
+
Retrieve new follow requests for a given profile.
|
|
1217
|
+
|
|
1218
|
+
Args:
|
|
1219
|
+
profile_id (str): The profile ID of the current user.
|
|
1220
|
+
limit (int): The number of requests to fetch. Default is 20.
|
|
1221
|
+
sort (str): The sorting order for the requests. Default is "FromMax".
|
|
1222
|
+
|
|
1223
|
+
Returns:
|
|
1224
|
+
Dict[str, Any]: The server's response containing new follow requests.
|
|
1225
|
+
"""
|
|
1226
|
+
payload = {
|
|
1227
|
+
"profile_id": profile_id,
|
|
1228
|
+
"limit": limit,
|
|
1229
|
+
"sort": sort
|
|
1230
|
+
}
|
|
1231
|
+
return self._reuests_post("getNewFollowRequests", data=payload)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Rubka
|
|
3
|
-
Version: 7.1.
|
|
3
|
+
Version: 7.1.7
|
|
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
|
rubka/__init__.py,sha256=P6IBiORfp-GqKHe5LZ-5lldWyG7tnrUYUcAQDUgwXmY,1973
|
|
2
2
|
rubka/api.py,sha256=wa1gQj7NDc7QEbmNNRz-TIOdVqfMWFC362tndRKdqig,68449
|
|
3
|
-
rubka/asynco.py,sha256=
|
|
3
|
+
rubka/asynco.py,sha256=ak94pBGnkPFZwHHOSAsWHo1JtOY92r-DNlzOWQkY_IE,110591
|
|
4
4
|
rubka/button.py,sha256=woSzZVd5MtTqOrP-YgkH5b0GS9y4DuKBsFSc9-KuLnk,13320
|
|
5
5
|
rubka/config.py,sha256=Bck59xkOiqioLv0GkQ1qPGnBXVctz1hKk6LT4h2EPx0,78
|
|
6
6
|
rubka/context.py,sha256=OowmsvqkThzB1NDhK5629Jm4ExdaWcjUo4rsBjpTtjA,38536
|
|
@@ -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=
|
|
15
|
+
rubka/rubino.py,sha256=HOILsm2zOIRe9EW1hxhLinhjwE_TvFrOAxBsg9T_L5E,61701
|
|
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.
|
|
41
|
-
rubka-7.1.
|
|
42
|
-
rubka-7.1.
|
|
43
|
-
rubka-7.1.
|
|
44
|
-
rubka-7.1.
|
|
40
|
+
rubka-7.1.7.dist-info/METADATA,sha256=C4Ix4P8Tj4hVdJs1P_ihKu5bKgqzEnEOTcmHTQaAjYo,34667
|
|
41
|
+
rubka-7.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
42
|
+
rubka-7.1.7.dist-info/entry_points.txt,sha256=4aESuUmuUOALMUy7Kucv_Gb5YlqhsJmTmdXLlZU9sJ0,46
|
|
43
|
+
rubka-7.1.7.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
|
|
44
|
+
rubka-7.1.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|