feat(weburl): add handler to retrieve and display the web panel URL

This commit is contained in:
MiliAxe
2025-12-31 13:10:11 +03:30
parent 6ab408c1d3
commit 68ba04fd77
3 changed files with 10 additions and 1 deletions

View File

@ -8,3 +8,4 @@ from .search import *
from .serverinfo import * from .serverinfo import *
from .cpu import * from .cpu import *
from .check_version import * from .check_version import *
from .weburl import *

View File

@ -4,5 +4,5 @@ def create_main_markup():
markup = types.ReplyKeyboardMarkup(resize_keyboard=True) markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
markup.row(' Add User', '🔍 Show User') markup.row(' Add User', '🔍 Show User')
markup.row('🗑️ Delete User', '🖥️ Server Info') markup.row('🗑️ Delete User', '🖥️ Server Info')
markup.row('💾 Backup Server') markup.row('💾 Backup Server', '🔗 Get Webpanel URL')
return markup return markup

View File

@ -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)