mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-06 20:04:51 +00:00
Fix
This commit is contained in:
parent
7e721da194
commit
cd5ca0eb87
1 changed files with 5 additions and 7 deletions
|
|
@ -9,6 +9,7 @@ from pyrogram import enums, filters
|
||||||
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
|
||||||
|
|
||||||
from misskaty import app, user
|
from misskaty import app, user
|
||||||
|
from misskaty.core.message_utils import editPesan, kirimPesan
|
||||||
from misskaty.vars import COMMAND_HANDLER, SUDO
|
from misskaty.vars import COMMAND_HANDLER, SUDO
|
||||||
|
|
||||||
__MODULE__ = "DevCommand"
|
__MODULE__ = "DevCommand"
|
||||||
|
|
@ -78,7 +79,7 @@ async def shell(_, m):
|
||||||
cmd = m.text.split(" ", 1)
|
cmd = m.text.split(" ", 1)
|
||||||
if len(m.command) == 1:
|
if len(m.command) == 1:
|
||||||
return await edit_or_reply(m, text="No command to execute was given.")
|
return await edit_or_reply(m, text="No command to execute was given.")
|
||||||
msg = await edit_or_reply(m, text="__Processing...__")
|
msg = await editPesan(m, "<i>Processing exec pyrogram...</i>") if m.from_user.is_self else await kirimPesan(m, "<i>Processing exec pyrogram...</i>")
|
||||||
shell = (await shell_exec(cmd[1]))[0]
|
shell = (await shell_exec(cmd[1]))[0]
|
||||||
if len(shell) > 3000:
|
if len(shell) > 3000:
|
||||||
with open("shell_output.txt", "w") as file:
|
with open("shell_output.txt", "w") as file:
|
||||||
|
|
@ -89,7 +90,7 @@ async def shell(_, m):
|
||||||
file_name=doc.name,
|
file_name=doc.name,
|
||||||
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
|
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
|
||||||
)
|
)
|
||||||
await m.delete() if m.from_user.is_self else await msg.delete()
|
await msg.delete()
|
||||||
try:
|
try:
|
||||||
os.remove("shell_output.txt")
|
os.remove("shell_output.txt")
|
||||||
except:
|
except:
|
||||||
|
|
@ -112,7 +113,7 @@ async def evaluation_cmd_t(_, m):
|
||||||
cmd = m.text.split(" ", 1)
|
cmd = m.text.split(" ", 1)
|
||||||
if len(m.command) == 1:
|
if len(m.command) == 1:
|
||||||
return await edit_or_reply(m, text="__No evaluate message!__")
|
return await edit_or_reply(m, text="__No evaluate message!__")
|
||||||
status_message = await edit_or_reply(m, text="__Processing eval pyrogram...__")
|
status_message = await editPesan(m, "<i>Processing eval pyrogram..</i>") if m.from_user.is_self else await kirimPesan(m, "<i>Processing eval pyrogram..</i>")
|
||||||
|
|
||||||
old_stderr = sys.stderr
|
old_stderr = sys.stderr
|
||||||
old_stdout = sys.stdout
|
old_stdout = sys.stdout
|
||||||
|
|
@ -153,9 +154,6 @@ async def evaluation_cmd_t(_, m):
|
||||||
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
|
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
|
||||||
)
|
)
|
||||||
os.remove("MissKatyEval.txt")
|
os.remove("MissKatyEval.txt")
|
||||||
if not m.from_user.is_self:
|
|
||||||
await m.delete()
|
|
||||||
else:
|
|
||||||
await status_message.delete()
|
await status_message.delete()
|
||||||
else:
|
else:
|
||||||
await edit_or_reply(
|
await edit_or_reply(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue