# ======================================= # _ __ __ __ _ # | |/ /___ | \/ | ___ __| |___ # | ' // _ \ | |\/| |/ _ \ / _` / __| # | . \ __/ | | | | (_) | (_| \__ \ # |_|\_\___| |_| |_|\___/ \__,_|___/ # @ke_mods # ======================================= # meta developer: @ke_mods import subprocess from .. import loader, utils @loader.tds class NeofetchMod(loader.Module): strings = { "name": "Neofetch", "not_installed": "Please, install Neofetch package", } strings_ru = { "not_installed": "Пожалуйста, установите пакет Neofetch", } strings_ua = { "not_installed": "Будь ласка, встановіть пакет Neofetch", } @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"
{utils.escape_html(output)}
") except FileNotFoundError: await utils.answer(message, self.strings["not_installed"])