mirror of https://github.com/coddrago/Heroku
commit
f09512fc3d
|
@ -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"
|
||||
|
|
|
@ -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>"
|
||||
|
|
|
@ -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: "Отправить информацию о юзерботе"
|
||||
|
|
|
@ -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: "Надіслати інформацію про юзербота"
|
||||
|
|
|
@ -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):
|
||||
|
@ -38,6 +41,12 @@ class HerokuInfoMod(loader.Module):
|
|||
True,
|
||||
validator=loader.validators.Boolean(),
|
||||
),
|
||||
loader.ConfigValue(
|
||||
"ping_emoji",
|
||||
"🪐",
|
||||
lambda: self.strings["ping_emoji"],
|
||||
validator=loader.validators.String(),
|
||||
),
|
||||
)
|
||||
|
||||
def _render_info(self, inline: bool) -> str:
|
||||
|
@ -97,8 +106,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 (
|
||||
|
@ -154,6 +166,9 @@ class HerokuInfoMod(loader.Module):
|
|||
|
||||
@loader.command()
|
||||
async def infocmd(self, message: Message):
|
||||
start = time.perf_counter_ns()
|
||||
message = await utils.answer(message, self.config["ping_emoji"])
|
||||
|
||||
if self.config.get('pp_to_banner', True):
|
||||
print(self.config['banner_url'])
|
||||
try:
|
||||
|
@ -166,7 +181,7 @@ class HerokuInfoMod(loader.Module):
|
|||
await utils.answer_file(
|
||||
message,
|
||||
self.config["banner_url"],
|
||||
self._render_info(False),
|
||||
self._render_info(False).format(ping=round((time.perf_counter_ns() - start) / 10**6, 3)),
|
||||
)
|
||||
|
||||
@loader.command()
|
||||
|
|
Loading…
Reference in New Issue