mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-16 21:48:03 +00:00
22 lines
766 B
Python
22 lines
766 B
Python
from sys import executable
|
|
|
|
from pyrogram import Client
|
|
|
|
from pagermaid.listener import listener
|
|
from pagermaid.utils import lang, execute, Message, alias_command
|
|
|
|
|
|
@listener(is_plugin=False, outgoing=True, command=alias_command("update"),
|
|
need_admin=True,
|
|
description=lang('update_des'),
|
|
parameters="<true/debug>")
|
|
async def update(_: Client, message: Message):
|
|
await execute('git fetch --all')
|
|
if len(message.parameter) > 0:
|
|
await execute('git reset --hard origin/master')
|
|
await execute('git pull --all')
|
|
await execute(f"{executable} -m pip install --upgrade -r requirements.txt")
|
|
await execute(f"{executable} -m pip install -r requirements.txt")
|
|
await message.edit(lang('update_success'))
|
|
exit(0)
|