async def install(event): if event.fwd_from: return if event.reply_to_msg_id: try: downloaded_file_name = ( await event.client.download_media( # pylint:disable=E0602 await event.get_reply_message(), "DaisyX/modules/", # pylint:disable=E0602 )) if "(" not in downloaded_file_name: path1 = Path(downloaded_file_name) shortname = path1.stem load_module(shortname.replace(".py", "")) await eor( event, "Plugin successfully installed\n {}".format( os.path.basename(downloaded_file_name)), ) else: os.remove(downloaded_file_name) await eor( event, "Error!\nModule cannot be installed!\n Or may have been pre-installed.", ) except Exception as e: # pylint:disable=C0103,W0703 await eor(event, str(e)) os.remove(downloaded_file_name) await asyncio.sleep(DELETE_TIMEOUT) await event.delete()
async def install(event): if event.fwd_from: return chat = Var.PLUGIN_CHANNEL documentss = await borg.get_messages(chat, None, filter=InputMessagesFilterDocument) total = int(documentss.total) total_doxx = range(0, total) await event.delete() for ixo in total_doxx: mxo = documentss[ixo].id downloaded_file_name = await event.client.download_media( await borg.get_messages(chat, ids=mxo), "DaisyX/modules/") if "(" not in downloaded_file_name: path1 = Path(downloaded_file_name) shortname = path1.stem load_module(shortname.replace(".py", "")) await borg.send_message( event.chat_id, "Installed Plugin `{}` successfully.".format( os.path.basename(downloaded_file_name)), ) else: await borg.send_message( event.chat_id, "Plugin `{}` has been pre-installed and cannot be installed.". format(os.path.basename(downloaded_file_name)), )
async def load(event): if event.fwd_from: return shortname = event.pattern_match["shortname"] try: try: remove_plugin(shortname) except BaseException: pass load_module(shortname) qwe = await eor(event, f"Successfully loaded {shortname}") except Exception as e: await qwe.edit( f"Daisy X could not load {shortname} because of the following error.\n{str(e)}" )
async def install(event): a = "Installing." b = 1 await event.edit(a) if event.fwd_from: return if event.reply_to_msg_id: try: downloaded_file_name = ( await event.client.download_media( # pylint:disable=E0602 await event.get_reply_message(), "./DaisyX/modules/", # pylint:disable=E0602 )) if "(" not in downloaded_file_name: path1 = Path(downloaded_file_name) shortname = path1.stem load_module(shortname.replace(".py", "")) if shortname in CMD_LIST: string = "Commands found in {}\n".format( (os.path.basename(downloaded_file_name))) for i in CMD_LIST[shortname]: string += " • " + i string += "\n" if b == 1: a = "Installing.." b = 2 else: a = "Installing..." b = 1 await event.edit(a) return await event.edit( f"Installed module\n{shortname}\n\n{string}") return await event.edit( f"Installed module {os.path.basename(downloaded_file_name)}" ) else: os.remove(downloaded_file_name) return await event.edit( f"Failed to Install \nError\nModule already installed or unknown formet" ) except Exception as e: await event.edit(f"Failed to Install \nError\n{str(e)}") return os.remove(downloaded_file_name)
path = "DaisyX/modules/assistant/*.py" files = glob.glob(path) for name in files: with open(name) as f: path1 = Path(f.name) shortname = path1.stem load_pro(shortname.replace(".py", "")) if "LEGENDX" != "DEVIL": path = "DaisyX/modules/*.py" files = glob.glob(path) for name in files: with open(name) as f: path1 = Path(f.name) shortname = path1.stem load_module(shortname.replace(".py", "")) else: print("f**k off kanger chala Ka madarchod") import os print("DaisyX is Up and Awake! ©️ TeamDaisyX 2021") async def legend(): pro = await xbot.get_me() legend = await bot.get_me() LEGENDX = f""" **Sᴏᴍᴇᴛʜɪɴɢ Hᴀᴘᴘᴇɴᴇᴅ ! Lᴇᴛs Cʜᴇᴄᴋ** 🤔 `☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎ ☟︎︎︎`