feat: add cpu, os, kernel version information in infocmd

pull/65/head
Rilliat 2025-01-14 22:58:13 +03:00
parent 69ef348770
commit 2e96584a36
5 changed files with 11 additions and 1 deletions

View File

@ -411,6 +411,7 @@ heroku_info:
branch: "Branch"
cpu_usage: "CPU-Nutzung"
ram_usage: "RAM-Nutzung"
non_detectable: "<emoji document_id=5210952531676504517>❌</emoji> <b>Diese Komponente kann auf Ihrem Server nicht erkannt werden!</b>"
send_info: "Sende Informationen zum Userbot"
description: " Dies wird keine persönlichen Informationen preisgeben"
_ihandle_doc_info: "Sende Informationen zum Userbot"

View File

@ -435,6 +435,7 @@ heroku_info:
branch: "Branch"
cpu_usage: "CPU usage"
ram_usage: "RAM usage"
non_detectable: "<emoji document_id=5210952531676504517>❌</emoji> <b>This component cannot be detected on your server!</b>"
send_info: "Send userbot info"
description: " This will not compromise any sensitive info"
up-to-date: "<emoji document_id=5370699111492229743>😌</emoji> <b>Up-to-date</b>"

View File

@ -402,6 +402,7 @@ heroku_info:
branch: "Ветка"
cpu_usage: "Использование CPU"
ram_usage: "Использование RAM"
non_detectable: "<emoji document_id=5210952531676504517>❌</emoji> <b>Этот компонент невозможно обнаружить на вашем сервере!</b>"
send_info: "Отправить информацию о юзерботе"
description: " Это не раскроет никакой личной информации"
_ihandle_doc_info: "Отправить информацию о юзерботе"

View File

@ -411,6 +411,7 @@ heroku_info:
branch: "Гілка"
cpu_usage: "ЦП"
ram_usage: "ОЗП"
non_detectable: "<emoji document_id=5210952531676504517>❌</emoji> <b>Цей компонент не може бути виявлений на вашому сервері!</b>"
send_info: "Надіслати інформацію про юзербота"
description: " Це не розкриє жодної особистої інформації"
_ihandle_doc_info: "Надіслати інформацію про юзербота"

View File

@ -6,6 +6,8 @@
import git
import time
import psutil
from hikkatl.tl.types import Message
from hikkatl.utils import get_display_name
import requests
@ -13,6 +15,7 @@ import os
from .. import loader, utils, version
from ..inline.types import InlineQuery
import subprocess
import platform as lib_platform
@loader.tds
class HerokuInfoMod(loader.Module):
@ -97,8 +100,11 @@ class HerokuInfoMod(loader.Module):
cpu_usage=utils.get_cpu_usage(),
ram_usage=f"{utils.get_ram_usage()} MB",
branch=version.branch,
hostname=subprocess.run(['hostname'], stdout=subprocess.PIPE).stdout.decode().strip(),
hostname=lib_platform.node(),
user=subprocess.run(['whoami'], stdout=subprocess.PIPE).stdout.decode().strip(),
os=lib_platform.freedesktop_os_release()["PRETTY_NAME"] or self.strings('non_detectable'),
kernel=lib_platform.release(),
cpu=f"{psutil.cpu_count(logical=False)} ({psutil.cpu_count()}) core(-s); {psutil.cpu_percent()}%",
)
if self.config["custom_message"]
else (