Last active 1767655611

Revision 27b77b2a807c4e3f1b382d35b405599b2a8e3c2d

upd_restart.py Raw
1import subprocess
2import sys
3
4@router.message(F.text == "/reboot")
5async def command_handler(msg: types.Message, *args, **kwargs):
6 if msg.from_user.id in [1234567890, 123123123]:
7 subprocess.run(["git", "pull"], check=True, stdout=subprocess.PIPE).stdout
8 python = sys.executable
9 os.execl(python, python, *sys.argv)