Files
limoka/radiocycle/Modules/Neofetch.py
2026-05-31 02:47:16 +00:00

44 lines
1.4 KiB
Python

# =======================================
# _ __ __ __ _
# | |/ /___ | \/ | ___ __| |___
# | ' // _ \ | |\/| |/ _ \ / _` / __|
# | . \ __/ | | | | (_) | (_| \__ \
# |_|\_\___| |_| |_|\___/ \__,_|___/
# @ke_mods
# =======================================
# meta developer: @ke_mods
import subprocess
from .. import loader, utils
@loader.tds
class NeofetchMod(loader.Module):
strings = {
"name": "Neofetch",
"not_installed": "<b>Please, install</b> <i>Neofetch</i> <b>package</b>",
}
strings_ru = {
"not_installed": "<b>Пожалуйста, установите пакет</b> <i>Neofetch</i>",
}
strings_ua = {
"not_installed": "<b>Будь ласка, встановіть пакет<b> <i>Neofetch</i>",
}
@loader.command(
ru_doc="- запустить команду neofetch",
ua_doc="- запустити команду neofetch",
)
async def neofetchcmd(self, message):
"""- run neofetch command"""
try:
result = subprocess.run(["neofetch", "--stdout"], capture_output=True, text=True)
output = result.stdout
await utils.answer(message, f"<pre>{utils.escape_html(output)}</pre>")
except FileNotFoundError:
await utils.answer(message, self.strings["not_installed"])