diff --git a/app.py b/app.py index 1785036..4167e82 100644 --- a/app.py +++ b/app.py @@ -642,7 +642,7 @@ def on_pm_message(data): ) # Route to AI if recipient is Violet - if room.endswith(f":{AI_BOT_NAME.lower()}"): + if f":{AI_BOT_NAME.lower()}" in room.lower(): if not user.get("user_id"): 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: diff --git a/static/chat.js b/static/chat.js index ca81338..4623b73 100644 --- a/static/chat.js +++ b/static/chat.js @@ -346,7 +346,7 @@ messageForm.addEventListener("submit", async (e) => { socket.emit("message", { text }); } else if (state.currentRoom.startsWith("pm:")) { - const isVioletRoom = state.currentRoom.toLowerCase().endsWith(":violet"); + const isVioletRoom = state.currentRoom.toLowerCase().includes(":violet"); if (isVioletRoom) { if (!state.isRegistered || !state.cryptoKey) {