From 74c6bcf7745128dcaf3d799a701bd3092e67de10 Mon Sep 17 00:00:00 2001 From: Seyed Mahdi <39972836+SeyedHashtag@users.noreply.github.com> Date: Mon, 15 Sep 2025 00:46:36 +0330 Subject: [PATCH] Enhance user interface by adding emoji to command buttons for better visibility --- core/scripts/telegrambot/utils/adduser.py | 2 +- core/scripts/telegrambot/utils/backup.py | 2 +- core/scripts/telegrambot/utils/common.py | 6 +++--- core/scripts/telegrambot/utils/deleteuser.py | 2 +- core/scripts/telegrambot/utils/edituser.py | 18 +++++++++--------- core/scripts/telegrambot/utils/serverinfo.py | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/scripts/telegrambot/utils/adduser.py b/core/scripts/telegrambot/utils/adduser.py index abacce7..6be2fab 100644 --- a/core/scripts/telegrambot/utils/adduser.py +++ b/core/scripts/telegrambot/utils/adduser.py @@ -16,7 +16,7 @@ def create_cancel_markup(back_step=None): markup.row(types.KeyboardButton("❌ Cancel")) return markup -@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == 'Add User') +@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == '➕ Add User') def add_user(message): msg = bot.reply_to(message, "Enter username (only letters, numbers, and underscores are allowed):", reply_markup=create_cancel_markup()) bot.register_next_step_handler(msg, process_add_user_step1) diff --git a/core/scripts/telegrambot/utils/backup.py b/core/scripts/telegrambot/utils/backup.py index c94dad6..6899d0f 100644 --- a/core/scripts/telegrambot/utils/backup.py +++ b/core/scripts/telegrambot/utils/backup.py @@ -11,7 +11,7 @@ from telebot import types from utils.command import * -@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == 'Backup Server') +@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == '💾 Backup Server') def backup_server(message): bot.reply_to(message, "Starting backup. This may take a few moments...") bot.send_chat_action(message.chat.id, 'typing') diff --git a/core/scripts/telegrambot/utils/common.py b/core/scripts/telegrambot/utils/common.py index 4794328..edf9c3c 100644 --- a/core/scripts/telegrambot/utils/common.py +++ b/core/scripts/telegrambot/utils/common.py @@ -2,7 +2,7 @@ from telebot import types 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('➕ Add User', '🔍 Show User') + markup.row('🗑️ Delete User', '🖥️ Server Info') + markup.row('💾 Backup Server') return markup diff --git a/core/scripts/telegrambot/utils/deleteuser.py b/core/scripts/telegrambot/utils/deleteuser.py index f486a0c..8fd2c76 100644 --- a/core/scripts/telegrambot/utils/deleteuser.py +++ b/core/scripts/telegrambot/utils/deleteuser.py @@ -9,7 +9,7 @@ def handle_cancel_delete(call): bot.edit_message_text("Operation canceled.", chat_id=call.message.chat.id, message_id=call.message.message_id) create_main_markup(call.message) -@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == 'Delete User') +@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == '🗑️ Delete User') def delete_user(message): markup = types.InlineKeyboardMarkup() cancel_button = types.InlineKeyboardButton("❌ Cancel", callback_data="cancel_delete") diff --git a/core/scripts/telegrambot/utils/edituser.py b/core/scripts/telegrambot/utils/edituser.py index 584eafb..ead6042 100644 --- a/core/scripts/telegrambot/utils/edituser.py +++ b/core/scripts/telegrambot/utils/edituser.py @@ -14,7 +14,7 @@ def handle_cancel_show_user(call): bot.edit_message_text("Operation canceled.", chat_id=call.message.chat.id, message_id=call.message.message_id) create_main_markup(call.message) -@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == 'Show User') +@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == '🔍 Show User') def show_user(message): markup = types.InlineKeyboardMarkup() cancel_button = types.InlineKeyboardButton("❌ Cancel", callback_data="cancel_show_user") @@ -106,14 +106,14 @@ def process_show_user(message): bio.seek(0) markup = types.InlineKeyboardMarkup(row_width=3) - markup.add(types.InlineKeyboardButton("Reset User", callback_data=f"reset_user:{actual_username}"), - types.InlineKeyboardButton("IPv6-URI", callback_data=f"ipv6_uri:{actual_username}")) - markup.add(types.InlineKeyboardButton("Edit Username", callback_data=f"edit_username:{actual_username}"), - types.InlineKeyboardButton("Edit Traffic Limit", callback_data=f"edit_traffic:{actual_username}")) - markup.add(types.InlineKeyboardButton("Edit Expiration Days", callback_data=f"edit_expiration:{actual_username}"), - types.InlineKeyboardButton("Renew Password", callback_data=f"renew_password:{actual_username}")) - markup.add(types.InlineKeyboardButton("Renew Creation Date", callback_data=f"renew_creation:{actual_username}"), - types.InlineKeyboardButton("Block User", callback_data=f"block_user:{actual_username}")) + markup.add(types.InlineKeyboardButton("🔄 Reset User", callback_data=f"reset_user:{actual_username}"), + types.InlineKeyboardButton("🌐 IPv6-URI", callback_data=f"ipv6_uri:{actual_username}")) + markup.add(types.InlineKeyboardButton("✏️ Edit Username", callback_data=f"edit_username:{actual_username}"), + types.InlineKeyboardButton("📶 Edit Traffic", callback_data=f"edit_traffic:{actual_username}")) + markup.add(types.InlineKeyboardButton("📅 Edit Expiration", callback_data=f"edit_expiration:{actual_username}"), + types.InlineKeyboardButton("🔑 Renew Password", callback_data=f"renew_password:{actual_username}")) + markup.add(types.InlineKeyboardButton("🕒 Renew Creation Date", callback_data=f"renew_creation:{actual_username}"), + types.InlineKeyboardButton("⛔ Block User", callback_data=f"block_user:{actual_username}")) caption = formatted_details if uri_v4: diff --git a/core/scripts/telegrambot/utils/serverinfo.py b/core/scripts/telegrambot/utils/serverinfo.py index db2bc89..c766223 100644 --- a/core/scripts/telegrambot/utils/serverinfo.py +++ b/core/scripts/telegrambot/utils/serverinfo.py @@ -2,7 +2,7 @@ from dotenv import load_dotenv from telebot import types from utils.command import * -@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == 'Server Info') +@bot.message_handler(func=lambda message: is_admin(message.from_user.id) and message.text == '🖥️ Server Info') def server_info(message): command = f"python3 {CLI_PATH} server-info" result = run_cli_command(command)