mirror of
https://github.com/Nick80835/microbot
synced 2025-09-05 00:45:55 +00:00
add sysd
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import asyncio
|
||||
from platform import python_version, uname
|
||||
from time import time_ns
|
||||
|
||||
@@ -45,6 +46,24 @@ async def help_cmd(event):
|
||||
await event.reply(f"`Available commands:`\n{help_string}")
|
||||
|
||||
|
||||
@ldr.add("sysd", sudo=True)
|
||||
async def sysd(event):
|
||||
try:
|
||||
neo = "neofetch --stdout"
|
||||
|
||||
fetch = await asyncio.create_subprocess_shell(
|
||||
neo,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
|
||||
stdout, stderr = await fetch.communicate()
|
||||
|
||||
await event.reply(f"`{stdout.decode().strip()}{stderr.decode().strip()}`")
|
||||
except FileNotFoundError:
|
||||
await event.reply("`Neofetch not found!`")
|
||||
|
||||
|
||||
@ldr.add("alive", sudo=True)
|
||||
async def alive(event):
|
||||
alive_format = "`μBot is running under {0}.\n\n" \
|
||||
|
Reference in New Issue
Block a user