|
|
@@ -196,16 +196,15 @@ async def broadcast_message(_, message):
|
|
|
|
|
|
# Update
|
|
|
|
|
|
-
|
|
|
@app.on_message(filters.command("update") & filters.user(SUDOERS))
|
|
|
async def update_restart(_, message):
|
|
|
try:
|
|
|
- await message.reply_text(
|
|
|
- f'```{subprocess.check_output(["git", "pull"]).decode("UTF-8")}```'
|
|
|
- )
|
|
|
+ out = subprocess.check_output(["git", "pull"]).decode("UTF-8")
|
|
|
+ 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))
|
|
|
m = await message.reply_text(
|
|
|
- "**Updated with default branch, restarting now.**"
|
|
|
- )
|
|
|
+ "**Updated with default branch, restarting now.**")
|
|
|
await restart(m)
|