Фото: уведомление о причине отказа модерации при входе в модуль
This commit is contained in:
@@ -124,7 +124,7 @@ async def main_menu(msg: Message):
|
||||
elif action == "PHOTO":
|
||||
USER_MENU_SHOWN[user_id] = True
|
||||
from photo_bot.handlers import check_moderation_status
|
||||
from utils.texts import photo_moderation_pending
|
||||
from utils.texts import photo_moderation_pending, photo_rejected_notice
|
||||
if not PHOTO_TEST_MODE:
|
||||
status = await check_moderation_status(user_id)
|
||||
if status.get("status") == "ok" and status.get("moderation_status") == "pending":
|
||||
@@ -135,6 +135,13 @@ async def main_menu(msg: Message):
|
||||
parse_mode="html"
|
||||
)
|
||||
return
|
||||
elif status.get("status") == "ok" and status.get("moderation_status") == "rejected":
|
||||
reason = (status.get("rejection_reason") or "Причина не указана.").strip()
|
||||
log_menu_stats(user_id, "Photo Bot", "Вход — фото отклонено, показана причина")
|
||||
await msg.answer(photo_rejected_notice(reason), parse_mode="html")
|
||||
# Кнопки остаются: пользователь отправляет новое фото (меню ниже)
|
||||
elif status.get("status") != "ok":
|
||||
logger.warning(f"Не удалось проверить статус модерации для {user_id}: {status.get('reason')}")
|
||||
set_state(user_id, "PHOTO_MODE")
|
||||
log_menu_stats(user_id, "Photo Bot (TEST)" if PHOTO_TEST_MODE else "Photo Bot", "Вход")
|
||||
from utils.texts import PHOTO_TEST_ENTRY_TEXT
|
||||
|
||||
@@ -245,6 +245,13 @@ def _photo_moderation_pending(photo_id: str, emojis: dict) -> str:
|
||||
f"{emojis['0']} — В главное меню"
|
||||
)
|
||||
|
||||
def _photo_rejected_notice(reason: str, emojis: dict) -> str:
|
||||
return (
|
||||
f"⚠️ <b>Ваше предыдущее фото было отклонено.</b>\n\n"
|
||||
f"📝 Причина: {reason}\n\n"
|
||||
f"Пожалуйста, отправьте новое фото."
|
||||
)
|
||||
|
||||
def _photo_test_welcome(emojis: dict) -> str:
|
||||
return (
|
||||
f"🧪 <b>Тестовый режим фото-проверки</b>\n\n"
|
||||
@@ -371,6 +378,9 @@ def photo_cancel_text() -> str:
|
||||
def photo_moderation_pending(photo_id: str) -> str:
|
||||
return _photo_moderation_pending(photo_id, EMOJI_DIGITS)
|
||||
|
||||
def photo_rejected_notice(reason: str) -> str:
|
||||
return _photo_rejected_notice(reason, EMOJI_DIGITS)
|
||||
|
||||
PHOTO_TEST_WELCOME_TEXT = _photo_test_welcome(EMOJI_DIGITS)
|
||||
PHOTO_TEST_PREVIEW_TEXT = _photo_test_preview(EMOJI_DIGITS)
|
||||
PHOTO_TEST_AI_CHECKING_TEXT = _photo_test_ai_checking(EMOJI_DIGITS)
|
||||
|
||||
Reference in New Issue
Block a user