$jsapi.chatHistory
The $jsapi.chatHistory()
method returns the dialog history of the current session in a simplified format.
A history is a list of various messages:
tip
To get the detailed dialog history in the JSON format,
use the chatHistoryJson
method.
How to use
The method is called without arguments.
- ECMAScript 5
- ECMAScript 6
state: history
q: dialog history
a: {{ $jsapi.chatHistory() }}
In the ECMAScript 6 runtime, the method is asynchronous:
state: history
q: dialog history
scriptEs6:
$reactions.answer(await $jsapi.chatHistory());
The method returns a string in the format:
CLIENT
[User request]
BOT
[First bot reply]
[Second bot reply]
[...]