added a pip command.

pull/102/head
Who? 2025-02-17 18:05:26 +07:00 committed by GitHub
parent 487e6cc4f1
commit 32afe153f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -39,7 +39,6 @@ logger = logging.getLogger(__name__)
def hash_msg(message): def hash_msg(message):
return f"{str(utils.get_chat_id(message))}/{str(message.id)}" return f"{str(utils.get_chat_id(message))}/{str(message.id)}"
async def read_stream(func: callable, stream, delay: float): async def read_stream(func: callable, stream, delay: float):
last_task = None last_task = None
data = b"" data = b""
@ -313,6 +312,14 @@ class TerminalMod(loader.Module):
@loader.command() @loader.command()
async def terminalcmd(self, message): async def terminalcmd(self, message):
await self.run_command(message, utils.get_args_raw(message)) await self.run_command(message, utils.get_args_raw(message))
@loader.command()
async def pipcmd(self, message):
await self.run_command(
message,
("pip " if os.geteuid() == 0 else "sudo -S apt ")
+ utils.get_args_raw(message)
)
@loader.command() @loader.command()
async def aptcmd(self, message): async def aptcmd(self, message):