diff --git a/app.py b/app.py index 45a1954..b9c3ce9 100644 --- a/app.py +++ b/app.py @@ -601,7 +601,7 @@ 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"): + if not user.get("user_id") and not user.get("is_admin"): emit("error", {"msg": "You must be registered to chat with Violet."}); return if not user.get("has_ai_access") and user.get("ai_messages_used", 0) >= AI_FREE_LIMIT: emit("pm_message", {"from": AI_BOT_NAME, "text": "ai_limit_reached", "room": room, "system": True}, to=sid) diff --git a/static/chat.js b/static/chat.js index a7efa8c..7acf933 100644 --- a/static/chat.js +++ b/static/chat.js @@ -428,6 +428,14 @@ messageForm.addEventListener("submit", async (e) => { messageInput.style.height = "auto"; }); +// Enter to send, Shift+Enter for newline +messageInput.addEventListener("keydown", (e) => { + if (e.key === "Enter" && !e.shiftKey) { + e.preventDefault(); + messageForm.requestSubmit(); + } +}); + // Auto-expand textarea messageInput.addEventListener("input", () => { messageInput.style.height = "auto";