[check] add the updater function
This commit is contained in:
parent
6386e0a8ae
commit
307aa2bb11
@ -33,6 +33,20 @@ from driver.decorators import bot_creator
|
||||
from driver.database.dbqueue import get_active_chats, remove_active_chat
|
||||
|
||||
|
||||
async def install_requirements(cmd: str) -> Tuple[str, str, int, int]:
|
||||
args = shlex.split(cmd)
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
*args, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE
|
||||
)
|
||||
stdout, stderr = await process.communicate()
|
||||
return (
|
||||
stdout.decode("utf-8", "replace").strip(),
|
||||
stderr.decode("utf-8", "replace").strip(),
|
||||
process.returncode,
|
||||
process.pid,
|
||||
)
|
||||
|
||||
|
||||
@Client.on_message(command(["update", f"update@{BOT_USERNAME}"]) & ~filters.edited)
|
||||
@bot_creator
|
||||
async def update_bot(_, message: Message):
|
||||
|
Loading…
Reference in New Issue
Block a user