mirror of
https://github.com/MuRuLOSE/limoka.git
synced 2026-06-17 06:44:18 +02:00
Added and updated repositories 2026-02-05 01:22:45
This commit is contained in:
48
radiocycle/Modules/Neofetch.py
Normal file
48
radiocycle/Modules/Neofetch.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# =======================================
|
||||
# _ __ __ __ _
|
||||
# | |/ /___ | \/ | ___ __| |___
|
||||
# | ' // _ \ | |\/| |/ _ \ / _` / __|
|
||||
# | . \ __/ | | | | (_) | (_| \__ \
|
||||
# |_|\_\___| |_| |_|\___/ \__,_|___/
|
||||
# @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"))
|
||||
|
||||
Reference in New Issue
Block a user