diff --git a/photo_bot/__pycache__/handlers.cpython-313.pyc b/photo_bot/__pycache__/handlers.cpython-313.pyc index a80bad3..d4257db 100644 Binary files a/photo_bot/__pycache__/handlers.cpython-313.pyc and b/photo_bot/__pycache__/handlers.cpython-313.pyc differ diff --git a/photo_bot/handlers.py b/photo_bot/handlers.py index a44ddb4..93333d6 100644 --- a/photo_bot/handlers.py +++ b/photo_bot/handlers.py @@ -180,9 +180,12 @@ async def send_dynamic_photo_main_menu(msg: Message, user_id: str): states.set_state(user_id, "PHOTO_MODE") moderation_pending_users.add(user_id) if config.PHOTO_TEST_MODE: - # Тест-режим: можно отправить фото на проверку в ИИ - test_submode_users.add(user_id) - await msg.answer(photo_test_welcome(photo_id), parse_mode="html") + # Единый вход: меню + «фото на модерации» + кнопка «1 — тест проверка фото». + # Описание тест-режима показываем ТОЛЬКО после нажатия кнопки 1 + await msg.answer( + photo_welcome_with_status(status, show_test=True), + parse_mode="html" + ) else: await msg.answer( photo_moderation_pending(photo_id), @@ -256,16 +259,19 @@ async def photo_module_handler(msg: Message): ) if still_pending: photo_id = status.get("photo_id", "???") - if config.PHOTO_TEST_MODE and in_test_submode(user_id): - # тест-режим: повторяем инфо (можно отправить фото на тест) + if config.PHOTO_TEST_MODE and (cmd == "1" or in_test_submode(user_id)): + # Вход в тест-под-режим (кнопка 1) / повтор его сообщения + test_submode_users.add(user_id) + log_menu_stats(user_id, "Photo Bot (TEST)", "Тест-под-режим (фото на модерации)") await msg.answer(photo_test_welcome(photo_id), parse_mode="html") else: - # стандартная ошибка: кнопок, кроме 0, нет + # стандартная ошибка: кнопок, кроме 0 (и 1 в тест-режиме), нет await msg.answer(photo_invalid_cmd(), parse_mode="html") return # Статус изменился (одобрено/отклонено) — разблокируем + was_in_test = in_test_submode(user_id) moderation_pending_users.discard(user_id) - if config.PHOTO_TEST_MODE: + if config.PHOTO_TEST_MODE and was_in_test: await msg.answer(PHOTO_TEST_WELCOME_TEXT, parse_mode="html") else: await msg.answer( diff --git a/utils/__pycache__/texts.cpython-313.pyc b/utils/__pycache__/texts.cpython-313.pyc index 25ac25c..d162623 100644 Binary files a/utils/__pycache__/texts.cpython-313.pyc and b/utils/__pycache__/texts.cpython-313.pyc differ diff --git a/utils/texts.py b/utils/texts.py index 387c710..98e6ddd 100644 --- a/utils/texts.py +++ b/utils/texts.py @@ -270,8 +270,10 @@ def _photo_status_info(status: dict = None, emojis: dict = None) -> str | None: f"Пожалуйста, отправьте новое фото." ) if ms == "pending": + photo_id = status.get("photo_id") + num = f" (№ {photo_id})" if photo_id not in (None, "", "???") else "" return ( - f"⏳ У вас уже есть фото на модерации.\n" + f"⏳ У вас уже есть фото на модерации{num}.\n" f"Ожидайте решения модератора." ) return None