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:
parent
fa030a32b7
commit
4e3583ef9a
11
app.py
11
app.py
|
|
@ -690,7 +690,16 @@ def on_pm_message(data):
|
||||||
# Route to AI if recipient is Violet
|
# Route to AI if recipient is Violet
|
||||||
if room.endswith(f":{AI_BOT_NAME.lower()}"):
|
if room.endswith(f":{AI_BOT_NAME.lower()}"):
|
||||||
if not user.get("user_id") and not user.get("is_admin"):
|
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:
|
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)
|
emit("ai_response", {"error": "ai_limit_reached", "room": room}, to=sid)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue