We are building a travel bot with ChatScript. We have a need to have a few variables which apply to user (and thus for all sessions with the user) and other variables which should be valid only for the session.
Example -
We need to remember where the user lives and their address. When the user re-connects to our bot, the bot need not ask for these details again once provided.
While the user’s home location does not change, the user’s travel itinerary changes for each session. The first time, the user wants to go from New Delhi to New York, the second time from Bangalore to San Francisco, etc.
The user’s $homelocation variable should not be cleared between sessions, but $from and $to must be reset at the beginning of each session.
What is the recommended way to do this in ChatScript?
As a related question, can we connect the bot to a database. For instance, user’s address is loaded from a database instead of storing in file system?