d4rktg 0.4.5__py3-none-any.whl → 0.4.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.
d4rk/Utils/__init__.py CHANGED
@@ -5,4 +5,4 @@ from ._delete import delete
5
5
  from ._ractions import Reacts
6
6
  from ._fonts import FontMessageMixin , get_font , web_app_data
7
7
  from ._movie_parser import parser
8
- from ._round import set_bot_cycle, round_robin
8
+ from ._round import round_robin
d4rk/Utils/_round.py CHANGED
@@ -2,33 +2,31 @@ from itertools import cycle
2
2
  from functools import wraps
3
3
  from pyrogram.types import Message
4
4
 
5
- last_selected = None
6
- bot_order = []
5
+ last_selected_per_chat = {}
7
6
 
8
7
  def round_robin():
9
8
  def decorator(func):
10
9
  @wraps(func)
11
10
  async def wrapper(client, message: Message, *args, **kwargs):
12
- global last_selected, bot_order
11
+ chat_id = message.chat.id
13
12
 
14
13
  # Private chats: all bots respond
15
14
  if message.chat.type.name.lower() == "private":
16
15
  return await func(client, message, *args, **kwargs)
17
16
 
18
- # If this chat is new, start order dynamically
19
- chat_id = message.chat.id
20
- if chat_id not in bot_order:
21
- bot_order.append(client.me.id)
22
- last_selected = client.me.id
17
+ # If first message in chat, set current bot as last_selected
18
+ if chat_id not in last_selected_per_chat:
19
+ last_selected_per_chat[chat_id] = client.me.id
23
20
 
24
- # Only the "current" bot responds
25
- if client.me.id == last_selected:
21
+ # Only the last_selected bot responds
22
+ if client.me.id == last_selected_per_chat[chat_id]:
26
23
  result = await func(client, message, *args, **kwargs)
27
24
 
28
- # Rotate for next message
29
- alive_bots = [b for b in bot_order if b is not None] # optionally skip dead bots
30
- idx = alive_bots.index(last_selected)
31
- last_selected = alive_bots[(idx + 1) % len(alive_bots)]
25
+ # rotate: pick the next bot (you'll need a list of bot IDs per chat)
26
+ bots_in_chat = list({client.me.id}) # replace with actual bot list
27
+ idx = bots_in_chat.index(client.me.id)
28
+ last_selected_per_chat[chat_id] = bots_in_chat[(idx + 1) % len(bots_in_chat)]
32
29
  return result
30
+
33
31
  return wrapper
34
- return decorator
32
+ return decorator
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d4rktg
3
- Version: 0.4.5
3
+ Version: 0.4.7
4
4
  Summary: A module for create with easy and fast
5
5
  Author: D4rkShell
6
6
  Author-email: premiumqtrst@gmail.com
@@ -9,16 +9,16 @@ d4rk/Logs/_logger.py,sha256=lqfVvCO0vZ_IaGOdIE4HA2KAUQZh7yW2iAHZcBz7F4o,4120
9
9
  d4rk/Models/__init__.py,sha256=7bYM2c5Uk_VEg7NxIGH2EcEXGcAguwxvH23-Gy1orMM,100
10
10
  d4rk/Models/_commands.py,sha256=U831pYCQbAYxyn3t6f49Wlk7vWycynR0sjxIOy0xjS8,2816
11
11
  d4rk/Models/_movie_title.py,sha256=Xp8eafBP-kD3MxAdeNcb7EyiAojn5fDQ18la7vxrg10,812
12
- d4rk/Utils/__init__.py,sha256=ZNBxoucjAtmcsxcgeypTqJ0PKi9EEEfrYhbScgwYBZQ,340
12
+ d4rk/Utils/__init__.py,sha256=uOF0bJacA7Lv944I4qHLtC-vKrgs7B7QFfmnKRfSVzw,325
13
13
  d4rk/Utils/_decorators.py,sha256=G5gGayvcpZRRVo6ondbRqQYDN4yVczlEdSHwaOQ_TLI,4145
14
14
  d4rk/Utils/_delete.py,sha256=gSmQAENGmM5XCCJfPuJ4vRMSxtixYG0vYdocU-2TSFg,581
15
15
  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=UswQKz9aTiJ4zA4JBqSSAJ7Y2IYBjb0XYP1cCDiSL28,1252
19
+ d4rk/Utils/_round.py,sha256=m6zD2aXmEyjybqhXAPa8BPWXeT47CDwf_cWSr9UTfJI,1269
20
20
  d4rk/Utils/_terminal.py,sha256=Anu4OcffY3v6LMOrCskP1cHrJIliomo1Hjownbhh2sQ,125
21
- d4rktg-0.4.5.dist-info/METADATA,sha256=QNJuUUb4J8mmDWyqjXvL4DMeRlFjyFshGEnfjnNJoiQ,652
22
- d4rktg-0.4.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
- d4rktg-0.4.5.dist-info/top_level.txt,sha256=qs1qTnKWImmGi7E0FoJS0OAEOHoVZA9vHRS3Pm6ncAo,5
24
- d4rktg-0.4.5.dist-info/RECORD,,
21
+ d4rktg-0.4.7.dist-info/METADATA,sha256=IbHAbarVjp6-5LxIe1_GBrerEql9YD8xeFWzUnFRzc4,652
22
+ d4rktg-0.4.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ d4rktg-0.4.7.dist-info/top_level.txt,sha256=qs1qTnKWImmGi7E0FoJS0OAEOHoVZA9vHRS3Pm6ncAo,5
24
+ d4rktg-0.4.7.dist-info/RECORD,,
File without changes