d4rktg 0.8.5__tar.gz → 0.8.7__tar.gz

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.
Files changed (33) hide show
  1. {d4rktg-0.8.5 → d4rktg-0.8.7}/PKG-INFO +1 -1
  2. d4rktg-0.8.7/VERSION.txt +1 -0
  3. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Handlers/_bot.py +1 -1
  4. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Models/_commands.py +1 -47
  5. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_round.py +1 -9
  6. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rktg.egg-info/PKG-INFO +1 -1
  7. d4rktg-0.8.5/VERSION.txt +0 -1
  8. {d4rktg-0.8.5 → d4rktg-0.8.7}/MANIFEST.in +0 -0
  9. {d4rktg-0.8.5 → d4rktg-0.8.7}/README.rst +0 -0
  10. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Database/__init__.py +0 -0
  11. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Database/db.py +0 -0
  12. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Handlers/__init__.py +0 -0
  13. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Handlers/_scheduler.py +0 -0
  14. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Logs/__init__.py +0 -0
  15. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Logs/_logger.py +0 -0
  16. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Models/__init__.py +0 -0
  17. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Models/_movie_title.py +0 -0
  18. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/__init__.py +0 -0
  19. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_decorators.py +0 -0
  20. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_delete.py +0 -0
  21. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_fonts.py +0 -0
  22. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_ip.py +0 -0
  23. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_movie_parser.py +0 -0
  24. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_ractions.py +0 -0
  25. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/Utils/_terminal.py +0 -0
  26. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rk/__init__.py +0 -0
  27. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rktg.egg-info/SOURCES.txt +0 -0
  28. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rktg.egg-info/dependency_links.txt +0 -0
  29. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rktg.egg-info/requires.txt +0 -0
  30. {d4rktg-0.8.5 → d4rktg-0.8.7}/d4rktg.egg-info/top_level.txt +0 -0
  31. {d4rktg-0.8.5 → d4rktg-0.8.7}/requirements.txt +0 -0
  32. {d4rktg-0.8.5 → d4rktg-0.8.7}/setup.cfg +0 -0
  33. {d4rktg-0.8.5 → d4rktg-0.8.7}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d4rktg
3
- Version: 0.8.5
3
+ Version: 0.8.7
4
4
  Summary: A module for create with easy and fast
5
5
  Author: D4rkShell
6
6
  Author-email: premiumqtrst@gmail.com
@@ -0,0 +1 @@
1
+ 0.8.7
@@ -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 (attempt {attempt + 1}): {e}")
93
+ logger.error(f"Error starting Client.Stoped !")
94
94
  logger.error(traceback.format_exc())
95
95
  break
96
96
  else:
@@ -9,6 +9,7 @@ from pyrogram.types import Message
9
9
 
10
10
  from d4rk.Logs import setup_logger
11
11
  from d4rk.Utils import clear_terminal
12
+ from d4rk.Utils._round import round_robin
12
13
 
13
14
  logger = setup_logger(__name__)
14
15
 
@@ -16,53 +17,6 @@ logger = setup_logger(__name__)
16
17
  command_registry = []
17
18
 
18
19
 
19
- last_index_per_chat = {}
20
- bot_order_per_chat = {}
21
- responded_messages = {}
22
- chat_locks = {}
23
-
24
- def round_robin():
25
- def decorator(func):
26
- @wraps(func)
27
- async def wrapper(client, message, *args, **kwargs):
28
- chat_id = message.chat.id
29
- msg_id = message.id
30
-
31
- # Private chats: all bots respond
32
- if message.chat.type.name.lower() == "private":
33
- return await func(client, message, *args, **kwargs)
34
-
35
- # Initialize tracking for this chat
36
- if chat_id not in bot_order_per_chat:
37
- bot_order_per_chat[chat_id] = [client.me.id]
38
- last_index_per_chat[chat_id] = 0
39
- responded_messages[chat_id] = set()
40
- chat_locks[chat_id] = asyncio.Lock()
41
-
42
- # Add new bot if not in the chat
43
- if client.me.id not in bot_order_per_chat[chat_id]:
44
- bot_order_per_chat[chat_id].append(client.me.id)
45
-
46
- async with chat_locks[chat_id]:
47
- # Skip if message already responded
48
- if msg_id in responded_messages[chat_id]:
49
- return
50
-
51
- # Decide which bot should respond
52
- current_index = last_index_per_chat[chat_id]
53
- selected_bot_id = bot_order_per_chat[chat_id][current_index]
54
-
55
- if client.me.id == selected_bot_id:
56
- result = await func(client, message, *args, **kwargs)
57
- # Mark message as responded
58
- responded_messages[chat_id].add(msg_id)
59
- # Rotate for next message
60
- last_index_per_chat[chat_id] = (current_index + 1) % len(bot_order_per_chat[chat_id])
61
- return result
62
-
63
- return wrapper
64
- return decorator
65
-
66
20
  def get_priority(description: str) -> int:
67
21
  desc_lower = description.lower()
68
22
  if "(owner only)" in desc_lower:
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d4rktg
3
- Version: 0.8.5
3
+ Version: 0.8.7
4
4
  Summary: A module for create with easy and fast
5
5
  Author: D4rkShell
6
6
  Author-email: premiumqtrst@gmail.com
d4rktg-0.8.5/VERSION.txt DELETED
@@ -1 +0,0 @@
1
- 0.8.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes