Add {hostname} placeholder in ping (useful for decorations like user@hostname in top of ping)

pull/31/head
Who? 2024-12-15 00:36:30 +07:00 committed by GitHub
commit 965bf88eb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 4 deletions

View File

@ -314,7 +314,7 @@ inline_stuff:
test:
set_loglevel: "<emoji document_id=5210952531676504517>🚫</emoji> <b>Gib das Log-Level als Zahl oder String an</b>"
no_logs: "<emoji document_id=5363948200291998612>🤷‍♀️</emoji> <b>Es gibt keine Logs mit dem Level</b> <code>{}</code><b>.</b>"
configping: "Ihr benutzerdefinierter Text. Platzhalter können verwendet werden: {ping} - Ihr Ping, {uptime} - Ihre Uptime, {ping_hint} - Hinweis"
configping: "Ihr benutzerdefinierter Text. Platzhalter können verwendet werden: {ping} - Ihr Ping, {uptime} - Ihre Uptime, {ping_hint} - Hinweis. Sie können den Platzhaltername {hostname} verwenden, wenn Sie den Hostname Ihres Servers benötigen"
hint: "Geben Sie einen Hinweis an"
ping_emoji: "Emoji, das bei einer leichten Ping-Erhöhung angezeigt wird."
logs_caption: "<emoji document_id=5188377234380954537>🌘</emoji> <b>Heroku-Logs des Levels</b> <code>{}</code>\n\n<emoji document_id=6318902906900711458>⚪️</emoji> <b>Version: {}.{}.{}</b>{}"

View File

@ -332,7 +332,7 @@ test:
name: "Tester"
set_loglevel: "<emoji document_id=5210952531676504517>🚫</emoji> <b>Please specify verbosity as an integer or string</b>"
no_logs: "<emoji document_id=5363948200291998612>🤷‍♀️</emoji> <b>You don't have any logs at verbosity</b> <code>{}</code><b>.</b>"
configping: "Your custom text. You can use placeholders: {ping} - That's your ping. {uptime} - It's your uptime. {ping_hint} - This is the same hint as in the heroku module, it is chosen with random chance, also you can specify this hint in the config "
configping: "Your custom text. You can use placeholders: {ping} - That's your ping. {uptime} - It's your uptime. {ping_hint} - This is the same hint as in the heroku module, it is chosen with random chance, also you can specify this hint in the config. You can use the {hostname} placeholder if you need the hostname of your server"
hint: "Set a hint"
ping_emoji: "Emoji that appears when ping does not increase significantly"
logs_caption: "<emoji document_id=5188377234380954537>🌘</emoji> <b>Heroku logs with verbosity</b> <code>{}</code>\n\n<emoji document_id=6318902906900711458>⚪️</emoji> <b>Version: {}.{}.{}</b>{}"

View File

@ -314,7 +314,7 @@ inline_stuff:
test:
set_loglevel: "<emoji document_id=5210952531676504517>🚫</emoji> <b>Укажи уровень логов числом или строкой</b>"
no_logs: "<emoji document_id=5363948200291998612>🤷‍♀️</emoji> <b>У тебя нет логов уровня</b> <code>{}</code><b>.</b>"
configping: "Ваш кастомный текст. Вы можете использовать плейсхолдеры: {ping} - Это ваш пинг, {uptime} - Это ваш аптайм, {ping_hint} - подсказка"
configping: "Ваш кастомный текст. Вы можете использовать плейсхолдеры: {ping} - Это ваш пинг, {uptime} - Это ваш аптайм, {ping_hint} - подсказка. Вы можете использовать плейсхолдер {hostname} если вам нужен hostname вашего сервера"
hint: "Укажите подсказку"
ping_emoji: "Эмодзи которое появляется при не значительном росте пинга."
logs_caption: "<emoji document_id=5188377234380954537>🌘</emoji> <b>Логи Heroku уровня</b> <code>{}</code>\n\n<emoji document_id=6318902906900711458>⚪️</emoji> <b>Версия: {}.{}.{}</b>{}"

View File

@ -314,7 +314,7 @@ inline_stuff:
test:
set_loglevel: "<emoji document_id=5210952531676504517>🚫</emoji> <b>Вкажи рівень логів числом або рядком</b>"
no_logs: "<emoji document_id=5363948200291998612>🤷‍♀️</emoji> <b>У тебе немає логів рівня</b> <code>{}</code><b>.</b>"
configping: "Ваш текст. Ви можете використовувати заміщення: {ping} - Це ваш пінг, {uptime} - Це ваш час роботи. {ping_hint} - Це той самий підказка, що й у модулі heroku, вона вибирається випадково, також ви можете вказати цю підказку у конфігурації"
configping: "Ваш текст. Ви можете використовувати заміщення: {ping} - Це ваш пінг, {uptime} - Це ваш час роботи. {ping_hint} - Це той самий підказка, що й у модулі heroku, вона вибирається випадково, також ви можете вказати цю підказку у конфігурації. Ви можте використовувати плейсхолдер {hostname} якщо вам потрібен hostname вашого сервера"
hint: "Встановіть підказку"
ping_emoji: "Емоджі, який з'являється, коли пінг не збільшується суттєво"
logs_caption: "<emoji document_id=5188377234380954537>🌘</emoji> <b>Логи Heroku рівня</b> <code>{}</code>\n\n<emoji document_id=6318902906900711458>⚪️</emoji> <b>Версія: {}.{}.{}</b>{}"

View File

@ -8,6 +8,7 @@ import inspect
import logging
import os
import random
import subprocess
import time
import typing
from io import BytesIO
@ -369,6 +370,7 @@ class TestMod(loader.Module):
ping_hint=(
(self.config["hint"]) if random.choice([0, 0, 1]) == 1 else ""
),
hostname=subprocess.run(['hostname'], stdout=subprocess.PIPE).stdout.decode('utf-8'),
),
)