v1.8.2: AGENTS.md, consent revocation, delete bot users, dialogues fix, intent improvements, CI for max_bot
This commit is contained in:
@@ -43,6 +43,7 @@ async def handle_consent_response(user_id: int, conv_id: int, text: str) -> None
|
||||
"Пожалуйста, дайте чёткий ответ — даёте ли вы согласие на обработку "
|
||||
"персональных данных? Это необходимо для обработки вашего запроса.",
|
||||
attachments=consent_keyboard(),
|
||||
conversation_id=conv_id,
|
||||
)
|
||||
|
||||
|
||||
@@ -70,6 +71,7 @@ async def handle_consent_yes(user_id: int, conv_id: int) -> None:
|
||||
"связаться с вами.\n\n"
|
||||
"Нажмите кнопку «Поделиться контактом» или введите номер телефона / email вручную.",
|
||||
attachments=contact_keyboard(),
|
||||
conversation_id=conv_id,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send consent_yes message: {e}")
|
||||
@@ -97,6 +99,7 @@ async def handle_consent_no(user_id: int, conv_id: int) -> None:
|
||||
f"Вы можете позвонить нам:\n{phone_text}\n\n"
|
||||
f"📧 {email}\n\n"
|
||||
f"Если передумаете и захотите дать согласие — просто напишите об этом.",
|
||||
conversation_id=conv_id,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send consent_no message: {e}")
|
||||
@@ -120,6 +123,7 @@ async def handle_refused_again(user_id: int, conv_id: int, text: str) -> None:
|
||||
f"Вы можете позвонить нам:\n{phone_text}\n\n"
|
||||
f"📧 {email}\n\n"
|
||||
f"Если передумаете — напишите «Даю согласие».",
|
||||
conversation_id=conv_id,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send refused_again message: {e}")
|
||||
@@ -134,6 +138,23 @@ async def handle_refused_again(user_id: int, conv_id: int, text: str) -> None:
|
||||
f"Вы можете позвонить нам:\n{phone_text}\n\n"
|
||||
f"📧 {email}\n\n"
|
||||
f"Если передумаете — напишите «Даю согласие».",
|
||||
conversation_id=conv_id,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send refused_again message: {e}")
|
||||
|
||||
|
||||
async def handle_revoke_consent(user_id: int, conv_id: int) -> None:
|
||||
async with async_session() as db:
|
||||
user = await db.get(BotUser, user_id)
|
||||
if user and user.consent_given:
|
||||
user.consent_given = False
|
||||
from app.handlers.greeting import moscow_now
|
||||
user.consent_revoked_date = moscow_now()
|
||||
await db.commit()
|
||||
await max_api.send_message(
|
||||
user_id,
|
||||
"Понял вас. Ваше согласие на обработку персональных данных отозвано. "
|
||||
"Если передумаете — напишите «Даю согласие».",
|
||||
conversation_id=conv_id,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user