Tressande Logo

SNACK HUB

Woman with beautiful hair

Login ๐Ÿ”‘

Snack Hub Chatbot
Logo Snack Hub Chatbot ๐Ÿ’ฌ
๐Ÿ‘‹ Welcome! Ask me anything about Snack Hub.
function openChat() { document.getElementById('chatPopup').classList.add("show"); document.body.style.overflow = 'hidden'; resetInactivityTimer(); } function closeChat() { document.getElementById('chatPopup').classList.remove("show"); document.body.style.overflow = 'auto'; clearTimeout(inactivityTimer); } function resetInactivityTimer() { clearTimeout(inactivityTimer); inactivityTimer = setTimeout(closeChat, 60000); } function sendMessage() { const input = document.getElementById('userInput'); const msg = input.value.trim(); if (!msg) return; appendMessage('user', msg); respondToUser(msg.toLowerCase()); input.value = ''; resetInactivityTimer(); } function respondToUser(message) { let response = "๐Ÿค” I'm not sure about that. Please contact our support team on WhatsApp.
+91 6307066009"; for (let key in responses) { if (message.includes(key)) { response = responses[key]; break; } } appendMessage('bot', response); } function appendMessage(sender, text) { const chatBody = document.getElementById('chatBody'); const row = document.createElement('div'); row.className = `msg-row ${sender}`; const msg = document.createElement('div'); msg.className = `chat-msg ${sender}`; msg.innerHTML = text; row.appendChild(msg); chatBody.appendChild(row); chatBody.scrollTop = chatBody.scrollHeight; } function quickReply(text) { document.getElementById('userInput').value = text; sendMessage(); }