Skip to content

Commit

Permalink
update Mix/mix_client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
naya1503 committed Jul 6, 2024
1 parent 6d44849 commit 99bf3fb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Mix/mix_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ async def start(self):
class Bot(Client):
def __init__(self, **kwargs):
super().__init__(
name="bot", api_id=api_id, api_hash=api_hash, bot_token=TOKEN_BOT, **kwargs
name="bot", api_id=api_id, api_hash=api_hash, bot_token=TOKEN_BOT, **kwargs, plugins=dict(root="assistant"),
)

def on_message(self, filters=None, group=-1):
Expand All @@ -302,11 +302,16 @@ def decorator(func):

async def start(self):
await super().start()
LOGGER.info(f"Importing Bot Modules...")
for plus in BOT_PLUGINS:
imported_module = importlib.import_module(f"assistant." + plus)
importlib.reload(imported_module)
LOGGER.info(f"Successfully Import Bot Modules...")
LOGGER.info(f"Importing Modules...")
for modul in USER_MOD:
imported_module = importlib.import_module(f"modular." + modul)
if hasattr(imported_module, "__modles__") and imported_module.__modles__:
imported_module.__modles__ = imported_module.__modles__
if hasattr(imported_module, "__help__") and imported_module.__help__:
CMD_HELP[imported_module.__modles__.replace(" ", "_").lower()] = (
imported_module
)
LOGGER.info(f"Successfully Import Modules...")
LOGGER.info(f"Starting Assistant {self.me.id}|{self.me.mention}")


Expand Down

0 comments on commit 99bf3fb

Please sign in to comment.