From 68ba04fd77ecb83c52f5910fff55d7769337755b Mon Sep 17 00:00:00 2001 From: MiliAxe Date: Wed, 31 Dec 2025 13:10:11 +0330 Subject: [PATCH] feat(weburl): add handler to retrieve and display the web panel URL --- core/scripts/telegrambot/utils/__init__.py | 1 + core/scripts/telegrambot/utils/common.py | 2 +- core/scripts/telegrambot/utils/weburl.py | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 core/scripts/telegrambot/utils/weburl.py diff --git a/core/scripts/telegrambot/utils/__init__.py b/core/scripts/telegrambot/utils/__init__.py index 49f6c6c..d771b25 100644 --- a/core/scripts/telegrambot/utils/__init__.py +++ b/core/scripts/telegrambot/utils/__init__.py @@ -8,3 +8,4 @@ from .search import * from .serverinfo import * from .cpu import * from .check_version import * +from .weburl import * diff --git a/core/scripts/telegrambot/utils/common.py b/core/scripts/telegrambot/utils/common.py index edf9c3c..e63b80a 100644 --- a/core/scripts/telegrambot/utils/common.py +++ b/core/scripts/telegrambot/utils/common.py @@ -4,5 +4,5 @@ def create_main_markup(): markup = types.ReplyKeyboardMarkup(resize_keyboard=True) markup.row('➕ Add User', '🔍 Show User') markup.row('🗑️ Delete User', '🖥️ Server Info') - markup.row('💾 Backup Server') + markup.row('💾 Backup Server', '🔗 Get Webpanel URL') return markup diff --git a/core/scripts/telegrambot/utils/weburl.py b/core/scripts/telegrambot/utils/weburl.py new file mode 100644 index 0000000..27b4095 --- /dev/null +++ b/core/scripts/telegrambot/utils/weburl.py @@ -0,0 +1,8 @@ +from utils.command import * + +@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == '🔗 Get Webpanel URL') +def get_webpanel_url_handler(message): + command = f"python3 {CLI_PATH} get-webpanel-url --url-only" + result = run_cli_command(command) + bot.send_chat_action(message.chat.id, 'typing') + bot.reply_to(message, "🌐 Webpanel URL:\n" + result) \ No newline at end of file