mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 18:44:51 +00:00
Add pypi search
This commit is contained in:
parent
79e58a9e19
commit
f99f987610
1 changed files with 14 additions and 0 deletions
|
|
@ -151,6 +151,20 @@ async def evaluation_cmd_t(_, m):
|
|||
reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton(text="❌ Close", callback_data=f"close#{m.from_user.id}")]]),
|
||||
)
|
||||
|
||||
# Update and restart bot
|
||||
@app.on_message(filters.command(["update"], COMMAND_HANDLER) & filters.user(SUDO))
|
||||
async def update_restart(_, message):
|
||||
try:
|
||||
out = (await shell_exec("git pull"))[0]
|
||||
if "Already up to date." in str(out):
|
||||
return await message.reply_text("Its already up-to date!")
|
||||
await message.reply_text(f"```{out}```")
|
||||
except Exception as e:
|
||||
return await message.reply_text(str(e))
|
||||
await message.reply_text(
|
||||
"**Updated with default branch, restarting now.**"
|
||||
)
|
||||
os.execvp(sys.executable, [sys.executable, "-m", "misskaty"])
|
||||
|
||||
async def aexec(code, c, m):
|
||||
exec("async def __aexec(c, m): " + "\n p = print" + "\n replied = m.reply_to_message" + "".join(f"\n {l_}" for l_ in code.split("\n")))
|
||||
|
|
|
|||
Loading…
Reference in a new issue