Ultroid - v0.0.4

ChangeLog - https://t.me/TheUltroid/26
This commit is contained in:
Aditya
2021-03-13 17:26:44 +05:30
committed by GitHub
parent a104e40539
commit cb317c5a72
56 changed files with 2800 additions and 631 deletions

View File

@@ -174,7 +174,7 @@ async def _(e):
c = await a.download_media(
"resources/downloads/",
progress_callback=lambda d, t: asyncio.get_event_loop().create_task(
progress(d, t, z, toime, "**Dɴʟᴀᴅɪɴɢ...**")
progress(d, t, z, toime, "Dɴʟᴀᴅɪɴɢ...")
),
)
await z.edit("**Dɴʟᴀᴅᴇᴅ...\nN Cɴᴇʀᴛɪɴɢ...**")
@@ -223,7 +223,7 @@ async def _(e):
video_note=True,
reply_to=a,
progress_callback=lambda d, t: asyncio.get_event_loop().create_task(
progress(d, t, z, taime, "**Uᴘʟᴀᴅɪɴɢ...**")
progress(d, t, z, taime, "Uᴘʟᴀᴅɪɴɢ...")
),
)
await z.delete()
@@ -263,20 +263,28 @@ async def _(event):
cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
)
stdout, stderr = await process.communicate()
OUT = f"**☞ BASH\n\n• COMMAND:**\n`{cmd}` \n\n"
OUT = f"<b>☞ BASH\n\n• COMMAND:</b>\n<code>{cmd}</code> \n\n"
e = stderr.decode()
if e:
OUT += f"**• ERROR:** \n`{e}`\n"
OUT += f"<b>• ERROR:</b> \n<code>{e}</code>\n"
o = stdout.decode()
if not o and not e:
o = "Success"
OUT += f"**• OUTPUT:**\n`{o}`"
OUT += f"<b>• OUTPUT:</b>\n<code>{o}</b>"
else:
_o = o.split("\n")
o = "`\n".join(_o)
OUT += f"**• OUTPUT:**\n{o}"
o = "\n".join(_o)
OUT += f"<b>• OUTPUT:</b>\n<code>{o}</code>"
if len(OUT) > 4096:
with io.BytesIO(str.encode(OUT)) as out_file:
ultd = (
OUT.replace("<code>", "")
.replace("</code>", "")
.replace("<b>", "")
.replace("</b>", "")
.replace("<i>", "")
.replace("</i>", "")
)
with io.BytesIO(str.encode(ultd)) as out_file:
out_file.name = "bash.txt"
await event.client.send_file(
event.chat_id,
@@ -288,7 +296,7 @@ async def _(event):
)
await xx.delete()
else:
await eod(xx, OUT)
await eod(xx, OUT, parse_mode="html")
@ultroid_cmd(
@@ -298,7 +306,7 @@ async def _(event):
if Redis("I_DEV") != "True":
await eor(
event,
f"Developer Restricted!\nIf you know what this does, and want to proceed\n\n `{HNDLR}setredis I_DEV True`\n\nThis Might Be Dangerous.",
f"Developer Restricted!\nIf you know what this does, and want to proceed\n\n {HNDLR}setredis I_DEV True\n\nThis Might Be Dangerous.",
)
return
xx = await eor(event, "`Processing ...`")
@@ -331,13 +339,19 @@ async def _(event):
evaluation = stdout
else:
evaluation = "Success"
final_output = (
"__►__ **EVAL**\n```{}``` \n\n __►__ **OUTPUT**: \n```{}``` \n".format(
cmd, evaluation
)
final_output = "<i>►</i> <b>EVAL</b>\n<code>{}</code>\n\n<i>►</i><b>OUTPUT</b>: \n<code>{}</code>".format(
cmd, evaluation
)
if len(final_output) > 4096:
with io.BytesIO(str.encode(final_output)) as out_file:
ultd = (
final_output.replace("<code>", "")
.replace("</code>", "")
.replace("<b>", "")
.replace("</b>", "")
.replace("<i>", "")
.replace("</i>", "")
)
with io.BytesIO(str.encode(ultd)) as out_file:
out_file.name = "eval.txt"
await ultroid_bot.send_file(
event.chat_id,
@@ -349,7 +363,7 @@ async def _(event):
)
await xx.delete()
else:
await eod(xx, final_output)
await eod(xx, final_output, parse_mode="html")
async def aexec(code, event):