Enhance user interface by adding emoji to command buttons for better visibility

This commit is contained in:
Seyed Mahdi
2025-09-15 00:46:36 +03:30
parent e8704ffda0
commit 74c6bcf774
6 changed files with 16 additions and 16 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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