Spaces:
Sleeping
Sleeping
Update static/index.html
Browse files134 unmodified lines13513613713813914014126 unmodified lines168169170171172173134 unmodified lines});document.getElementById("close-button").addEventListener("click", closeChat);async function sendMessage() {const input = document.getElementById("user-input");const userId = document.getElementById("user-id").value;const message = input.value.trim();26 unmodified lines}}async function closeChat() {const userId = document.getElementById("user-id").value;134 unmodified lines13513613713813914014114214314414514614714814915015115215326 unmodified lines180181182183184185186187188134 unmodified lines});document.getElementById("close-button").addEventListener("click", closeChat);window.addEventListener('DOMContentLoaded', () => {sendInitialBotMessage(); // Trigger initial message when chatbot opens});function sendInitialBotMessage() {const userId = document.getElementById("user-id").value;const initialMessage = "Hello! How can I assist you today?"; // Initial bot messageaddMessage("Bot", initialMessage, "bot-message"); // Display the initial bot messagechatHistoryArray.push({ userId, sender: "Bot", message: initialMessage }); // Save to chat history}async function sendMessage() {const input = document.getElementById("user-input");const userId = document.getElementById("user-id").value;const message = input.value.trim();26 unmodified lines}}async function closeChat() {const userId = document.getElementById("user-id").value;
static/index.html+16-1