d4rktg 1.1.1__py3-none-any.whl → 1.1.3__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.
- d4rk/Handlers/_custom.py +6 -4
- d4rk/Utils/_decorators.py +6 -3
- {d4rktg-1.1.1.dist-info → d4rktg-1.1.3.dist-info}/METADATA +1 -1
- {d4rktg-1.1.1.dist-info → d4rktg-1.1.3.dist-info}/RECORD +6 -6
- {d4rktg-1.1.1.dist-info → d4rktg-1.1.3.dist-info}/WHEEL +0 -0
- {d4rktg-1.1.1.dist-info → d4rktg-1.1.3.dist-info}/top_level.txt +0 -0
d4rk/Handlers/_custom.py
CHANGED
@@ -20,10 +20,12 @@ class FontMessageMixin(Client):
|
|
20
20
|
|
21
21
|
async def send_reaction(self,chat_id:Union[int,str], message_id:int=None, story_id:int=None, emoji:Union[int,str,List[Union[int,str]]]=None, big:bool=False, add_to_recent:bool=False, *args, **kwargs):
|
22
22
|
global worker_running
|
23
|
-
await
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
try:return await super().send_reaction(chat_id=chat_id,message_id=message_id,story_id=story_id,emoji=emoji,big=big,add_to_recent=add_to_recent)
|
24
|
+
except FloodWait:
|
25
|
+
await reaction_queue.put([chat_id, message_id, story_id, emoji, big, add_to_recent])
|
26
|
+
if not worker_running:
|
27
|
+
worker_running = True
|
28
|
+
asyncio.create_task(self.reaction_worker())
|
27
29
|
|
28
30
|
|
29
31
|
async def reaction_worker(self) -> None:
|
d4rk/Utils/_decorators.py
CHANGED
@@ -39,7 +39,8 @@ def new_task():
|
|
39
39
|
def decorator(func):
|
40
40
|
@wraps(func)
|
41
41
|
async def wrapper(*args, **kwargs):
|
42
|
-
asyncio.create_task(func(*args, **kwargs))
|
42
|
+
task = asyncio.create_task(func(*args, **kwargs))
|
43
|
+
return await task
|
43
44
|
return wrapper
|
44
45
|
return decorator
|
45
46
|
|
@@ -66,7 +67,8 @@ def round_robin():
|
|
66
67
|
msg_id = message.id
|
67
68
|
|
68
69
|
if message.chat.type.name.lower() == "private":
|
69
|
-
|
70
|
+
task = asyncio.create_task(func(client, message))
|
71
|
+
return await task
|
70
72
|
|
71
73
|
if chat_id not in bot_order_per_chat:
|
72
74
|
bot_order_per_chat[chat_id] = [client.me.id]
|
@@ -84,7 +86,8 @@ def round_robin():
|
|
84
86
|
selected_bot_id = bot_order_per_chat[chat_id][current_index]
|
85
87
|
|
86
88
|
if client.me.id == selected_bot_id:
|
87
|
-
|
89
|
+
task = asyncio.create_task(func(client, message))
|
90
|
+
result = await task
|
88
91
|
responded_messages[chat_id].add(msg_id)
|
89
92
|
last_index_per_chat[chat_id] = (current_index + 1) % len(bot_order_per_chat[chat_id])
|
90
93
|
return result
|
@@ -3,20 +3,20 @@ d4rk/Database/__init__.py,sha256=TQB5D8PBDCq80jPq6rsC2G939yYYKTh_bCcOWsZ-nA8,18
|
|
3
3
|
d4rk/Database/db.py,sha256=5T-dbHPQp9JF2rQb707SLSSkAaz8ghX4lO7g_Siy7oA,1870
|
4
4
|
d4rk/Handlers/__init__.py,sha256=BBdnh4RAPXNJ1loFq6l-5FELzMNSSAkr0JWWiBl3GkA,102
|
5
5
|
d4rk/Handlers/_bot.py,sha256=_gmSQtsCFG7vNcIZ_b-2FCKHC5oaBKt-K6FTKFxtN7s,8977
|
6
|
-
d4rk/Handlers/_custom.py,sha256=
|
6
|
+
d4rk/Handlers/_custom.py,sha256=ibOW0mqQD-oMy9wFnSehEHOeJw2tkkg4dM77qglNsVg,7374
|
7
7
|
d4rk/Handlers/_scheduler.py,sha256=AyqexO4nxZlIzRfU9vWTfJtTWQVQmP4de7GRPg-3JkA,1236
|
8
8
|
d4rk/Logs/__init__.py,sha256=mXWD5jXnyH3_AvS7K_ki3iw5BpoEAvrDFbmr-iEFNnY,22
|
9
9
|
d4rk/Logs/_logger.py,sha256=lqfVvCO0vZ_IaGOdIE4HA2KAUQZh7yW2iAHZcBz7F4o,4120
|
10
10
|
d4rk/Utils/__init__.py,sha256=YL8lDvupE1mX9DPeM2g9QNpfATph8j2SNCDUZCIeACg,362
|
11
11
|
d4rk/Utils/_buttons.py,sha256=gehLWh0NOQSkSNAIuUBEJ8jN2uzNDail2tJboV4656w,3311
|
12
|
-
d4rk/Utils/_decorators.py,sha256=
|
12
|
+
d4rk/Utils/_decorators.py,sha256=fJE__avjKQh-IV0wz1AEGu4fFDPOgsb2xdEi8cJv_YM,3873
|
13
13
|
d4rk/Utils/_filters.py,sha256=r_Dait6tcAg4drqDgBsIYKg7BA4Pd8S1yEbdGHj3A0g,2781
|
14
14
|
d4rk/Utils/_fonts.py,sha256=4zpjAmhAhRGzkSaD1b80p_bpwF72mOe7ykcpJFc688w,3690
|
15
15
|
d4rk/Utils/_ip.py,sha256=KJJW2QSngshIVWCO5YPXF1wj4IPQzVN5oFofpfzlU5w,559
|
16
16
|
d4rk/Utils/_movie_parser.py,sha256=Pyd_eSyzp0bBMfil0YY0zypsDWBk7LoDQBfMOQJh16Y,6204
|
17
17
|
d4rk/Utils/_ractions.py,sha256=wOVPyoFnbDuMgoP6NF_gLO1DYcfhERC0trdAK1jWSE8,2170
|
18
18
|
d4rk/Utils/_terminal.py,sha256=Anu4OcffY3v6LMOrCskP1cHrJIliomo1Hjownbhh2sQ,125
|
19
|
-
d4rktg-1.1.
|
20
|
-
d4rktg-1.1.
|
21
|
-
d4rktg-1.1.
|
22
|
-
d4rktg-1.1.
|
19
|
+
d4rktg-1.1.3.dist-info/METADATA,sha256=YLKKn0SkgcHCUXLw28N4wNb2QcKnoBeovgxKrhOFsxY,652
|
20
|
+
d4rktg-1.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
21
|
+
d4rktg-1.1.3.dist-info/top_level.txt,sha256=qs1qTnKWImmGi7E0FoJS0OAEOHoVZA9vHRS3Pm6ncAo,5
|
22
|
+
d4rktg-1.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|