0
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset = "UTF-8">
    <title>Hello</title>
    <script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script>
    <script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script>
</head>
<body>
    <df-messenger
            intent="WELCOME"
            chat-title=""
            agent-id=""
            language-code="en"
    ></df-messenger>
</body>
</html>

I have only one HTML file which has the above contents. I want to store the chat details on the localstorage of the browser so that I can retrieve the chat on page refresh.

Monil Shah
  • 39
  • 1
  • 6
  • awesome, what are your attempts to store this in the localStorage and what problem(s) are you facing while doing it? Also can you elaborate more in the sentence "unable to restore chat"?, what exactly is the error? (if there are any) – I_love_vegetables Aug 03 '21 at 06:01
  • I was to store all chat on localStorage, I don't know how to implement that. I just know that I will require js to do so. "unable to restore chat" - I want to store all the conversation between bot and users. – Monil Shah Aug 03 '21 at 13:12

1 Answers1

0

You can achieve this storing the chat in a database. Make sure all intents enable the fulfillment so each incoming message/request is sent to the Webhook. Your webhook can store data in the database, send an email or generate an event to control the conversation flow: do not set the actual (text) response from your webhook but only define the actual responses in the Intent screen.

Some answers/tutorials that might help you:

Jaime Lopez
  • 113
  • 4