Violet replies to unregistered guests with friendly signup prompt

Instead of a silent error event, guests who PM Violet now see their
message echoed back plus a flirty reply telling them to register.
This commit is contained in:
3nd3r 2026-04-12 14:50:31 -05:00
parent fa030a32b7
commit 4e3583ef9a
1 changed files with 10 additions and 1 deletions

11
app.py
View File

@ -690,7 +690,16 @@ def on_pm_message(data):
# Route to AI if recipient is Violet
if room.endswith(f":{AI_BOT_NAME.lower()}"):
if not user.get("user_id") and not user.get("is_admin"):
emit("error", {"msg": "You must be registered to chat with Violet."}); return
# Echo their message, then reply as Violet
emit("pm_message", payload, to=sid)
emit("pm_message", {
"from": AI_BOT_NAME,
"text": "Hey hun 💜 You'll need to register an account before we can chat. "
"Go back and sign up — I'll be waiting for you! 😘",
"room": room,
"ts": _ts(),
}, to=sid)
return
if not user.get("has_ai_access") and user.get("ai_messages_used", 0) >= AI_FREE_LIMIT:
emit("ai_response", {"error": "ai_limit_reached", "room": room}, to=sid)
return