mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-16 14:34:17 +02:00
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
# =======================================
|
|
# _ __ __ __ _
|
|
# | |/ /___ | \/ | ___ __| |___
|
|
# | ' // _ \ | |\/| |/ _ \ / _` / __|
|
|
# | . \ __/ | | | | (_) | (_| \__ \
|
|
# |_|\_\___| |_| |_|\___/ \__,_|___/
|
|
# @ke_mods
|
|
# =======================================
|
|
#
|
|
# LICENSE: CC BY-ND 4.0 (Attribution-NoDerivatives 4.0 International)
|
|
# --------------------------------------
|
|
# https://creativecommons.org/licenses/by-nd/4.0/legalcode
|
|
# =======================================
|
|
|
|
# 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"))
|
|
|