d4rktg 0.8.5__py3-none-any.whl → 0.8.6__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/_bot.py +1 -1
- d4rk/Utils/_round.py +1 -9
- {d4rktg-0.8.5.dist-info → d4rktg-0.8.6.dist-info}/METADATA +1 -1
- {d4rktg-0.8.5.dist-info → d4rktg-0.8.6.dist-info}/RECORD +6 -6
- {d4rktg-0.8.5.dist-info → d4rktg-0.8.6.dist-info}/WHEEL +0 -0
- {d4rktg-0.8.5.dist-info → d4rktg-0.8.6.dist-info}/top_level.txt +0 -0
d4rk/Handlers/_bot.py
CHANGED
@@ -90,7 +90,7 @@ class BotManager(Client):
|
|
90
90
|
except AccessTokenExpired:
|
91
91
|
logger.error(f"Access token expired (attempt {attempt + 1})")
|
92
92
|
except Exception as e:
|
93
|
-
logger.error(f"Error starting Client
|
93
|
+
logger.error(f"Error starting Client.Stoped !")
|
94
94
|
logger.error(traceback.format_exc())
|
95
95
|
break
|
96
96
|
else:
|
d4rk/Utils/_round.py
CHANGED
@@ -18,36 +18,28 @@ def round_robin():
|
|
18
18
|
async def wrapper(client, message, *args, **kwargs):
|
19
19
|
chat_id = message.chat.id
|
20
20
|
msg_id = message.id
|
21
|
-
|
22
|
-
# Private chats: all bots respond
|
21
|
+
|
23
22
|
if message.chat.type.name.lower() == "private":
|
24
23
|
return await func(client, message, *args, **kwargs)
|
25
24
|
|
26
|
-
# Initialize tracking for this chat
|
27
25
|
if chat_id not in bot_order_per_chat:
|
28
26
|
bot_order_per_chat[chat_id] = [client.me.id]
|
29
27
|
last_index_per_chat[chat_id] = 0
|
30
28
|
responded_messages[chat_id] = set()
|
31
29
|
chat_locks[chat_id] = asyncio.Lock()
|
32
30
|
|
33
|
-
# Add new bot if not in the chat
|
34
31
|
if client.me.id not in bot_order_per_chat[chat_id]:
|
35
32
|
bot_order_per_chat[chat_id].append(client.me.id)
|
36
33
|
|
37
34
|
async with chat_locks[chat_id]:
|
38
|
-
# Skip if message already responded
|
39
35
|
if msg_id in responded_messages[chat_id]:
|
40
36
|
return
|
41
|
-
|
42
|
-
# Decide which bot should respond
|
43
37
|
current_index = last_index_per_chat[chat_id]
|
44
38
|
selected_bot_id = bot_order_per_chat[chat_id][current_index]
|
45
39
|
|
46
40
|
if client.me.id == selected_bot_id:
|
47
41
|
result = await func(client, message, *args, **kwargs)
|
48
|
-
# Mark message as responded
|
49
42
|
responded_messages[chat_id].add(msg_id)
|
50
|
-
# Rotate for next message
|
51
43
|
last_index_per_chat[chat_id] = (current_index + 1) % len(bot_order_per_chat[chat_id])
|
52
44
|
return result
|
53
45
|
|
@@ -2,7 +2,7 @@ d4rk/__init__.py,sha256=Xq5qqX-FwosTJBLrSPF53FPD6fEISH750hbImZpSu5k,202
|
|
2
2
|
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=lO1b7Tnu3GWgwcJmX5qepiNqaBBi6qTgjj0SlzVUyEA,63
|
5
|
-
d4rk/Handlers/_bot.py,sha256=
|
5
|
+
d4rk/Handlers/_bot.py,sha256=gyujdbtMHFTqjdBKDD6IJghf4qTTbQz_dobUXxbZ9i8,8959
|
6
6
|
d4rk/Handlers/_scheduler.py,sha256=AyqexO4nxZlIzRfU9vWTfJtTWQVQmP4de7GRPg-3JkA,1236
|
7
7
|
d4rk/Logs/__init__.py,sha256=mXWD5jXnyH3_AvS7K_ki3iw5BpoEAvrDFbmr-iEFNnY,22
|
8
8
|
d4rk/Logs/_logger.py,sha256=lqfVvCO0vZ_IaGOdIE4HA2KAUQZh7yW2iAHZcBz7F4o,4120
|
@@ -16,9 +16,9 @@ d4rk/Utils/_fonts.py,sha256=CQsDqPgvp27t3f75Cxod0EmZogEssLwIpyesH-YY5KM,7518
|
|
16
16
|
d4rk/Utils/_ip.py,sha256=KJJW2QSngshIVWCO5YPXF1wj4IPQzVN5oFofpfzlU5w,559
|
17
17
|
d4rk/Utils/_movie_parser.py,sha256=QEPd3z04p4pk2vxZ-2fYlRxHmQbmwQd2mCIlBsBM5AY,7039
|
18
18
|
d4rk/Utils/_ractions.py,sha256=wOVPyoFnbDuMgoP6NF_gLO1DYcfhERC0trdAK1jWSE8,2170
|
19
|
-
d4rk/Utils/_round.py,sha256=
|
19
|
+
d4rk/Utils/_round.py,sha256=LaQlklg4f8n4cJjVzeYisd8l9D1gYNuQ9Ka41v8XWtE,1696
|
20
20
|
d4rk/Utils/_terminal.py,sha256=Anu4OcffY3v6LMOrCskP1cHrJIliomo1Hjownbhh2sQ,125
|
21
|
-
d4rktg-0.8.
|
22
|
-
d4rktg-0.8.
|
23
|
-
d4rktg-0.8.
|
24
|
-
d4rktg-0.8.
|
21
|
+
d4rktg-0.8.6.dist-info/METADATA,sha256=SKjJ1MNQ9SsMkA1gGZGGKWeaErigs210946DP5LhqWw,652
|
22
|
+
d4rktg-0.8.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
d4rktg-0.8.6.dist-info/top_level.txt,sha256=qs1qTnKWImmGi7E0FoJS0OAEOHoVZA9vHRS3Pm6ncAo,5
|
24
|
+
d4rktg-0.8.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|