diff --git a/main.py b/main.py index 89bf5ad..d174198 100644 --- a/main.py +++ b/main.py @@ -155,9 +155,9 @@ async def btn_my_code(message: Message): await show_verification_code(message) -@router.message(F.text == "💳 Мои счета") +@router.message(F.text == "� Мои логины") async def btn_my_accounts(message: Message): - """Обработчик кнопки 'Мои счета'""" + """Обработчик кнопки 'Мои логины'""" from src.handlers.registration_handlers import show_user_accounts await show_user_accounts(message) @@ -182,9 +182,9 @@ async def btn_exit_chat(message: Message, state: FSMContext): await exit_chat(message, state) -@router.message(F.text == "🏠 Главное меню") +@router.message(F.text == "🏠 Главная") async def btn_main_menu(message: Message): - """Обработчик кнопки 'Главное меню'""" + """Обработчик кнопки 'Главная'""" await cmd_start(message) diff --git a/src/handlers/admin_panel.py b/src/handlers/admin_panel.py index 84e36f7..1d3176c 100644 --- a/src/handlers/admin_panel.py +++ b/src/handlers/admin_panel.py @@ -483,7 +483,7 @@ async def confirm_create_lottery(callback: CallbackQuery, state: FSMContext): text, reply_markup=InlineKeyboardMarkup(inline_keyboard=[ [InlineKeyboardButton(text="🎰 К управлению розыгрышами", callback_data="admin_lotteries")], - [InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")] + [InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")] ]) ) diff --git a/src/handlers/chat_handlers.py b/src/handlers/chat_handlers.py index 86db91b..58976d8 100644 --- a/src/handlers/chat_handlers.py +++ b/src/handlers/chat_handlers.py @@ -66,7 +66,7 @@ async def enter_chat(message: Message, state: FSMContext): keyboard = InlineKeyboardMarkup(inline_keyboard=[ [InlineKeyboardButton(text="🚪 Выйти из чата", callback_data="exit_chat")], - [InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")] + [InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")] ]) # Обычная клавиатура для чата @@ -118,7 +118,7 @@ async def exit_chat(message: Message, state: FSMContext): keyboard = InlineKeyboardMarkup(inline_keyboard=[ [InlineKeyboardButton(text="💬 Войти в чат", callback_data="enter_chat")], - [InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")] + [InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")] ]) # Обычная клавиатура diff --git a/src/handlers/help_handlers.py b/src/handlers/help_handlers.py index 6d20b4e..c8f1ac6 100644 --- a/src/handlers/help_handlers.py +++ b/src/handlers/help_handlers.py @@ -22,7 +22,7 @@ def get_help_menu_keyboard() -> InlineKeyboardMarkup: [InlineKeyboardButton(text="🎰 Участие в розыгрышах", callback_data="help_lottery")], [InlineKeyboardButton(text="💬 Чат", callback_data="help_chat")], [InlineKeyboardButton(text="⚙️ Команды", callback_data="help_commands")], - [InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")] + [InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")] ] return InlineKeyboardMarkup(inline_keyboard=buttons) @@ -31,7 +31,7 @@ def get_back_to_help_keyboard() -> InlineKeyboardMarkup: """Клавиатура возврата к справке""" buttons = [ [InlineKeyboardButton(text="◀️ Назад к справке", callback_data="help_main")], - [InlineKeyboardButton(text="🏠 В главное меню", callback_data="back_to_main")] + [InlineKeyboardButton(text="🏠 Главная", callback_data="back_to_main")] ] return InlineKeyboardMarkup(inline_keyboard=buttons) diff --git a/src/handlers/registration_handlers.py b/src/handlers/registration_handlers.py index 50834e8..6899448 100644 --- a/src/handlers/registration_handlers.py +++ b/src/handlers/registration_handlers.py @@ -143,7 +143,20 @@ async def process_club_card(message: Message, state: FSMContext): @router.message(StateFilter(RegistrationStates.waiting_for_phone)) async def process_phone(message: Message, state: FSMContext): """Обработка номера телефона""" - phone = None if message.text.strip() == "-" else message.text.strip() + phone_input = message.text.strip() + + # Проверяем, не отправил ли пользователь просто "-" + if phone_input == "-": + phone = None + else: + # Валидируем телефон: не должно быть пустых или некорректных значений + if not phone_input: + await message.answer( + "❌ Неверный номер телефона.\n\n" + "Пожалуйста, введите корректный номер или отправьте '-' чтобы пропустить." + ) + return + phone = phone_input data = await state.get_data() club_card_number = data['club_card_number'] diff --git a/src/utils/keyboards.py b/src/utils/keyboards.py index b185e3b..6e9420e 100644 --- a/src/utils/keyboards.py +++ b/src/utils/keyboards.py @@ -17,8 +17,8 @@ def get_main_reply_keyboard(is_admin: bool = False, is_registered: bool = False) # Первая строка - основные команды row1 = [ - KeyboardButton(text="🎰 Розыгрыши"), - KeyboardButton(text="💬 Чат") + KeyboardButton(text="💬 Чат"), + KeyboardButton(text="❓ Справка") ] keyboard.append(row1) @@ -29,13 +29,13 @@ def get_main_reply_keyboard(is_admin: bool = False, is_registered: bool = False) if is_registered or is_admin: row2.append(KeyboardButton(text="🔑 Мой код")) - row2.append(KeyboardButton(text="💳 Мои счета")) + row2.append(KeyboardButton(text="📱 Мои логины")) if row2: keyboard.append(row2) - # Третья строка - справка - row3 = [KeyboardButton(text="❓ Справка")] + # Третья строка - главная + row3 = [KeyboardButton(text="🏠 Главная")] # Админские команды if is_admin: @@ -59,7 +59,7 @@ def get_chat_reply_keyboard() -> ReplyKeyboardMarkup: """ keyboard = [ [KeyboardButton(text="🚪 Выйти из чата")], - [KeyboardButton(text="🏠 Главное меню")] + [KeyboardButton(text="🏠 Главная")] ] return ReplyKeyboardMarkup(