Rubka 6.6.2__py3-none-any.whl → 6.6.5__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/__init__.py +1 -0
- rubka/asynco.py +48 -47
- rubka/rubino.py +59 -8
- {rubka-6.6.2.dist-info → rubka-6.6.5.dist-info}/METADATA +24 -10
- {rubka-6.6.2.dist-info → rubka-6.6.5.dist-info}/RECORD +8 -7
- rubka-6.6.5.dist-info/entry_points.txt +2 -0
- {rubka-6.6.2.dist-info → rubka-6.6.5.dist-info}/WHEEL +0 -0
- {rubka-6.6.2.dist-info → rubka-6.6.5.dist-info}/top_level.txt +0 -0
rubka/__init__.py
CHANGED
rubka/asynco.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import asyncio,aiohttp,aiofiles,time,datetime,json,tempfile,os,sys,subprocess,mimetypes
|
|
2
|
-
from typing import List, Optional, Dict, Any, Literal, Callable, Union
|
|
2
|
+
from typing import List, Optional, Dict, Any, Literal, Callable, Union,Set
|
|
3
3
|
from .exceptions import APIRequestError
|
|
4
4
|
from .adaptorrubka import Client as Client_get
|
|
5
5
|
from .logger import logger
|
|
6
|
+
from .rubino import Bot as Rubino
|
|
6
7
|
from . import filters
|
|
7
8
|
try:from .context import Message, InlineMessage
|
|
8
9
|
except (ImportError, ModuleNotFoundError):from context import Message, InlineMessage
|
|
@@ -787,52 +788,52 @@ class Robot:
|
|
|
787
788
|
|
|
788
789
|
|
|
789
790
|
async def run(
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
791
|
+
self,
|
|
792
|
+
debug: bool = False,
|
|
793
|
+
sleep_time: float = 0.2,
|
|
794
|
+
webhook_timeout: int = 20,
|
|
795
|
+
update_limit: int = 100,
|
|
796
|
+
retry_delay: float = 5.0,
|
|
797
|
+
stop_on_error: bool = False,
|
|
798
|
+
max_errors: int = 0,
|
|
799
|
+
auto_restart: bool = False,
|
|
800
|
+
max_runtime: Optional[float] = None,
|
|
801
|
+
loop_forever: bool = True,
|
|
802
|
+
allowed_update_types: Optional[List[str]] = None,
|
|
803
|
+
ignore_duplicate_messages: bool = True,
|
|
804
|
+
skip_inline_queries: bool = False,
|
|
805
|
+
skip_channel_posts: bool = False,
|
|
806
|
+
skip_service_messages: bool = False,
|
|
807
|
+
skip_edited_messages: bool = False,
|
|
808
|
+
skip_bot_messages: bool = False,
|
|
809
|
+
log_file: Optional[str] = None,
|
|
810
|
+
log_level: str = "info",
|
|
811
|
+
print_exceptions: bool = True,
|
|
812
|
+
error_handler: Optional[Callable[[Exception], Any]] = None,
|
|
813
|
+
shutdown_hook: Optional[Callable[[], Any]] = None,
|
|
814
|
+
save_unprocessed_updates: bool = False,
|
|
815
|
+
log_to_console: bool = True,
|
|
816
|
+
rate_limit: Optional[float] = None,
|
|
817
|
+
max_message_size: Optional[int] = None,
|
|
818
|
+
ignore_users: Optional[Set[str]] = None,
|
|
819
|
+
ignore_groups: Optional[Set[str]] = None,
|
|
820
|
+
require_auth_token: bool = False,
|
|
821
|
+
only_private_chats: bool = False,
|
|
822
|
+
only_groups: bool = False,
|
|
823
|
+
require_admin_rights: bool = False,
|
|
824
|
+
custom_update_fetcher: Optional[Callable[[], Any]] = None,
|
|
825
|
+
custom_update_processor: Optional[Callable[[Any], Any]] = None,
|
|
826
|
+
process_in_background: bool = False,
|
|
827
|
+
max_queue_size: int = 1000,
|
|
828
|
+
thread_workers: int = 3,
|
|
829
|
+
message_filter: Optional[Callable[[Any], bool]] = None,
|
|
830
|
+
pause_on_idle: bool = False,
|
|
831
|
+
max_concurrent_tasks: Optional[int] = None,
|
|
832
|
+
metrics_enabled: bool = False,
|
|
833
|
+
metrics_handler: Optional[Callable[[dict], Any]] = None,
|
|
834
|
+
notify_on_error: bool = False,
|
|
835
|
+
notification_handler: Optional[Callable[[str], Any]] = None,
|
|
836
|
+
watchdog_timeout: Optional[float] = None,
|
|
836
837
|
):
|
|
837
838
|
"""
|
|
838
839
|
Starts the bot's main execution loop with extensive configuration options.
|
rubka/rubino.py
CHANGED
|
@@ -446,7 +446,7 @@ class Bot():
|
|
|
446
446
|
"api_version":"0",
|
|
447
447
|
"client":{
|
|
448
448
|
"app_name":"Main",
|
|
449
|
-
"app_version":"2.
|
|
449
|
+
"app_version":"2.4.7",
|
|
450
450
|
"package":"m.rubika.ir",
|
|
451
451
|
"platform":"PWA"
|
|
452
452
|
},
|
|
@@ -926,6 +926,20 @@ class Bot():
|
|
|
926
926
|
"profile_id": profile_id
|
|
927
927
|
},methode="getProfileFollowers")
|
|
928
928
|
|
|
929
|
+
def get_Highlight_StoryIds(self,highlight_id:str,profile_id:str,target_profile_id:str):
|
|
930
|
+
return self._reuests_post(data={
|
|
931
|
+
"highlight_id": highlight_id,
|
|
932
|
+
"profile_id": profile_id,
|
|
933
|
+
"target_profile_id": target_profile_id
|
|
934
|
+
},methode="getHighlightStoryIds")
|
|
935
|
+
def get_Highlight_Stories(self,highlight_id:str,profile_id:str,target_profile_id:str,story_ids:list):
|
|
936
|
+
return self._reuests_post(data={
|
|
937
|
+
"highlight_id": highlight_id,
|
|
938
|
+
"profile_id": profile_id,
|
|
939
|
+
"target_profile_id": target_profile_id,
|
|
940
|
+
"story_ids":story_ids
|
|
941
|
+
},methode="getHighlightStories")
|
|
942
|
+
|
|
929
943
|
def get_NewFollow_Requests(self,sort:str="FromMax",limit:int=50,equal:bool=False,profile_id:str=None):
|
|
930
944
|
return self._reuests_post(data={
|
|
931
945
|
"equal": equal,
|
|
@@ -955,14 +969,37 @@ class Bot():
|
|
|
955
969
|
"track_id": "Related",
|
|
956
970
|
"profile_id": profile_id
|
|
957
971
|
},methode="postBookmarkAction")
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
972
|
+
def get_saved_posts(
|
|
973
|
+
self,
|
|
974
|
+
max_id: str,
|
|
975
|
+
limit: int = 20,
|
|
976
|
+
profile_id: Optional[str] = None,
|
|
977
|
+
sort: str = "FromMax") -> Dict[str, Any]:
|
|
978
|
+
"""
|
|
979
|
+
دریافت پستهای ذخیرهشده (بوکمارکشده)
|
|
980
|
+
|
|
981
|
+
Args:
|
|
982
|
+
max_id (str): شناسه آخرین پست برای صفحهبندی.
|
|
983
|
+
limit (int, optional): تعداد پستها در هر درخواست. پیشفرض 20.
|
|
984
|
+
profile_id (str, optional): شناسه پروفایل (در صورت نیاز).
|
|
985
|
+
sort (str, optional): نوع مرتبسازی. پیشفرض "FromMax".
|
|
986
|
+
|
|
987
|
+
Returns:
|
|
988
|
+
Dict[str, Any]: پاسخ سرور شامل لیست پستهای ذخیرهشده.
|
|
989
|
+
"""
|
|
990
|
+
payload = {
|
|
962
991
|
"limit": limit,
|
|
963
|
-
"
|
|
964
|
-
"
|
|
965
|
-
}
|
|
992
|
+
"max_id": max_id,
|
|
993
|
+
"sort": sort
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
if profile_id is not None:
|
|
997
|
+
payload["profile_id"] = profile_id
|
|
998
|
+
|
|
999
|
+
return self._reuests_post(
|
|
1000
|
+
data=payload,
|
|
1001
|
+
methode="getBookmarkedPosts"
|
|
1002
|
+
)
|
|
966
1003
|
|
|
967
1004
|
def search_Page(self,username:str,sort:str="FromMax",limit:int=50,equal:bool=False,profile_id:str=None):
|
|
968
1005
|
return self._reuests_post(data={
|
|
@@ -994,6 +1031,14 @@ class Bot():
|
|
|
994
1031
|
"record_id": post_id,
|
|
995
1032
|
"profile_id": profile_id
|
|
996
1033
|
},methode="setReportRecord")
|
|
1034
|
+
def report_Post(self,post_profile_id,post_id:str,reason:int=2,profile_id:str=None):
|
|
1035
|
+
return self._reuests_post(data={
|
|
1036
|
+
"model": "Post",
|
|
1037
|
+
"reason": reason,
|
|
1038
|
+
"post_profile_id":post_profile_id,
|
|
1039
|
+
"record_id": post_id,
|
|
1040
|
+
"profile_id": profile_id
|
|
1041
|
+
},methode="setReportRecord")
|
|
997
1042
|
|
|
998
1043
|
def delete_Post(self,post_id:str,profile_id:str=None):
|
|
999
1044
|
return self._reuests_post(data={
|
|
@@ -1013,6 +1058,12 @@ class Bot():
|
|
|
1013
1058
|
"profile_status": profile_status,
|
|
1014
1059
|
"profile_id": profile_id
|
|
1015
1060
|
},methode="updateProfile")
|
|
1061
|
+
def get_New_Events(self,limit:int=20,sort:str="FromMax",profile_id:str=None):
|
|
1062
|
+
return self._reuests_post(data={
|
|
1063
|
+
"limit": limit,
|
|
1064
|
+
"profile_id": profile_id,
|
|
1065
|
+
"sort":sort
|
|
1066
|
+
},methode="updateProfile")
|
|
1016
1067
|
|
|
1017
1068
|
def allow_Send_MessagePv(self,is_message_allowed:bool=False,profile_id:str=None):
|
|
1018
1069
|
return self._reuests_post(data={
|
|
@@ -1,18 +1,29 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Rubka
|
|
3
|
-
Version: 6.6.
|
|
4
|
-
Summary: A Python library for interacting with Rubika Bot API.
|
|
3
|
+
Version: 6.6.5
|
|
4
|
+
Summary: rubika A Python library for interacting with Rubika Bot API.
|
|
5
5
|
Home-page: https://github.com/Mahdy-Ahmadi/Rubka
|
|
6
|
-
Download-URL: https://github.com/Mahdy-Ahmadi/rubka/
|
|
6
|
+
Download-URL: https://github.com/Mahdy-Ahmadi/rubka/archive/refs/tags/v6.6.4.zip
|
|
7
7
|
Author: Mahdi Ahmadi
|
|
8
8
|
Author-email: mahdiahmadi.1208@gmail.com
|
|
9
9
|
Maintainer: Mahdi Ahmadi
|
|
10
10
|
Maintainer-email: mahdiahmadi.1208@gmail.com
|
|
11
|
+
License: MIT
|
|
12
|
+
Project-URL: Bug Tracker, https://t.me/Bprogrammer
|
|
13
|
+
Project-URL: Documentation, https://github.com/Mahdy-Ahmadi/rubka/blob/main/README.md
|
|
14
|
+
Project-URL: Source Code, https://github.com/Mahdy-Ahmadi/Rubka
|
|
15
|
+
Keywords: rubika bot api library chat messaging rubpy pyrubi rubigram
|
|
16
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
11
18
|
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
22
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
23
|
Classifier: Operating System :: OS Independent
|
|
14
24
|
Classifier: Topic :: Communications :: Chat
|
|
15
25
|
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Natural Language :: Persian
|
|
16
27
|
Requires-Python: >=3.6
|
|
17
28
|
Description-Content-Type: text/markdown
|
|
18
29
|
Requires-Dist: requests
|
|
@@ -31,8 +42,11 @@ Dynamic: description
|
|
|
31
42
|
Dynamic: description-content-type
|
|
32
43
|
Dynamic: download-url
|
|
33
44
|
Dynamic: home-page
|
|
45
|
+
Dynamic: keywords
|
|
46
|
+
Dynamic: license
|
|
34
47
|
Dynamic: maintainer
|
|
35
48
|
Dynamic: maintainer-email
|
|
49
|
+
Dynamic: project-url
|
|
36
50
|
Dynamic: requires-dist
|
|
37
51
|
Dynamic: requires-python
|
|
38
52
|
Dynamic: summary
|
|
@@ -62,16 +76,16 @@ If `importlib.metadata` is not available, it installs `importlib-metadata` autom
|
|
|
62
76
|
## 🚀 Getting Started
|
|
63
77
|
|
|
64
78
|
```python
|
|
65
|
-
from rubka import Robot
|
|
79
|
+
from rubka.asynco import Robot
|
|
66
80
|
from rubka.context import Message
|
|
67
|
-
|
|
81
|
+
import asyncio
|
|
68
82
|
bot = Robot(token="YOUR_TOKEN_HERE")
|
|
69
83
|
|
|
70
84
|
@bot.on_message(commands=["start"])
|
|
71
|
-
def start(bot: Robot, message: Message):
|
|
72
|
-
message.reply("سلام! خوش آمدید!")
|
|
85
|
+
async def start(bot: Robot, message: Message):
|
|
86
|
+
await message.reply("سلام! خوش آمدید!")
|
|
73
87
|
|
|
74
|
-
bot.run()
|
|
88
|
+
asyncio.run(bot.run())
|
|
75
89
|
```
|
|
76
90
|
|
|
77
91
|
---
|
|
@@ -82,8 +96,8 @@ You can handle incoming text messages using `@bot.on_message()`:
|
|
|
82
96
|
|
|
83
97
|
```python
|
|
84
98
|
@bot.on_message(commands=["hello"])
|
|
85
|
-
def greet(bot: Robot, message: Message):
|
|
86
|
-
|
|
99
|
+
async def greet(bot: Robot, message: Message):
|
|
100
|
+
await message.reply("سلام کاربر عزیز 👋")
|
|
87
101
|
```
|
|
88
102
|
|
|
89
103
|
You can also add filters.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
rubka/__init__.py,sha256=
|
|
1
|
+
rubka/__init__.py,sha256=mM3oIYKWqil2AEU5i0jzh6QBdho12Ec73EzZYh_Sy1Q,229
|
|
2
2
|
rubka/api.py,sha256=FkvXi6lGyDhy-GStfT9IPtmnpir75ggNsC4bsgy2tKw,68838
|
|
3
|
-
rubka/asynco.py,sha256=
|
|
3
|
+
rubka/asynco.py,sha256=V0PW63HpBZJ1B39aKRPKU0gHDqriH7u9Z-6LFiFaWQg,83562
|
|
4
4
|
rubka/button.py,sha256=vU9OvWXCD4MRrTJ8Xmivd4L471-06zrD2qpZBTw5vjY,13305
|
|
5
5
|
rubka/config.py,sha256=Bck59xkOiqioLv0GkQ1qPGnBXVctz1hKk6LT4h2EPx0,78
|
|
6
6
|
rubka/context.py,sha256=4YZs7DiZD_HWOqY76hwwajG0J-bLy6wjeKtQT3EatZU,19341
|
|
@@ -11,7 +11,7 @@ rubka/jobs.py,sha256=GvLMLsVhcSEzRTgkvnPISPEBN71suW2xXI0hUaUZPTo,378
|
|
|
11
11
|
rubka/keyboards.py,sha256=7nr-dT2bQJVQnQ6RMWPTSjML6EEk6dsBx-4d8pab8xk,488
|
|
12
12
|
rubka/keypad.py,sha256=yGsNt8W5HtUFBzVF1m_p7GySlu1hwIcSvXZ4BTdrlvg,9558
|
|
13
13
|
rubka/logger.py,sha256=J2I6NiK1z32lrAzC4H1Et6WPMBXxXGCVUsW4jgcAofs,289
|
|
14
|
-
rubka/rubino.py,sha256=
|
|
14
|
+
rubka/rubino.py,sha256=GuXnEUTTSZUw68FMTQBYsB2zG_3rzdDa-krsrl4ib8w,58755
|
|
15
15
|
rubka/update.py,sha256=4YZs7DiZD_HWOqY76hwwajG0J-bLy6wjeKtQT3EatZU,19341
|
|
16
16
|
rubka/utils.py,sha256=XUQUZxQt9J2f0X5hmAH_MH1kibTAfdT1T4AaBkBhBBs,148
|
|
17
17
|
rubka/adaptorrubka/__init__.py,sha256=6o2tCXnVeES7nx-LjnzsuMqjKcWIm9qwKficLE54s-U,83
|
|
@@ -35,7 +35,8 @@ rubka/adaptorrubka/types/socket/message.py,sha256=0WgLMZh4eow8Zn7AiSX4C3GZjQTkIg
|
|
|
35
35
|
rubka/adaptorrubka/utils/__init__.py,sha256=OgCFkXdNFh379quNwIVOAWY2NP5cIOxU5gDRRALTk4o,54
|
|
36
36
|
rubka/adaptorrubka/utils/configs.py,sha256=nMUEOJh1NqDJsf9W9PurkN_DLYjO6kKPMm923i4Jj_A,492
|
|
37
37
|
rubka/adaptorrubka/utils/utils.py,sha256=5-LioLNYX_TIbQGDeT50j7Sg9nAWH2LJUUs-iEXpsUY,8816
|
|
38
|
-
rubka-6.6.
|
|
39
|
-
rubka-6.6.
|
|
40
|
-
rubka-6.6.
|
|
41
|
-
rubka-6.6.
|
|
38
|
+
rubka-6.6.5.dist-info/METADATA,sha256=dgy1GFcgPaq2ILJI-byO8NuOmB0Xvdp1fv7hKjC2B3U,34043
|
|
39
|
+
rubka-6.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
40
|
+
rubka-6.6.5.dist-info/entry_points.txt,sha256=4aESuUmuUOALMUy7Kucv_Gb5YlqhsJmTmdXLlZU9sJ0,46
|
|
41
|
+
rubka-6.6.5.dist-info/top_level.txt,sha256=vy2A4lot11cRMdQS-F4HDCIXL3JK8RKfu7HMDkezJW4,6
|
|
42
|
+
rubka-6.6.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|