sycgram/plugins/sysinfo.py

15 lines
447 B
Python
Raw Normal View History

2022-04-06 14:39:27 +00:00
from core import command
from pyrogram import Client
from pyrogram.types import Message
from tools.helpers import basher
@Client.on_message(command("sysinfo"))
async def sysinfo(_: Client, msg: Message):
"""查询系统信息"""
res = await basher("neofetch --config none --stdout")
if not res.get('error'):
await msg.edit_text(f"```{res.get('output')}```")
else:
await msg.edit_text(f"```{res.get('error')}```")