mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:21:31 +00:00
Update documentation with message queueing stuff
This commit is contained in:
parent
958b44e570
commit
ea5ed41485
30
README.md
30
README.md
@ -97,12 +97,40 @@ The message format used:
|
||||
"data":
|
||||
{
|
||||
"originator": ...,
|
||||
"timestamp": ...,
|
||||
"message": ...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This component can be used as a simple chatbot as well.
|
||||
|
||||
You can provide a list of messages to queue and they will be automatically displayed one after the other.
|
||||
There is a wait time between each message so that the user can properly read them.
|
||||
This wait time is calculated from the length of the last message, and can be configured using the `messages.messageQueueWPM` key in `config.ts`.
|
||||
|
||||
You can queue messages like so:
|
||||
|
||||
```
|
||||
{
|
||||
"key": "queueMessages",
|
||||
"data":
|
||||
{
|
||||
"messages":
|
||||
[
|
||||
{
|
||||
"originator": ...
|
||||
"message": ...
|
||||
},
|
||||
{
|
||||
"originator": ...
|
||||
"message": ...
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can use the `MessageSender` class to send messages from the TFW server or event handlers written in Python.
|
||||
|
||||
### Web – customisable component
|
||||
|
Loading…
Reference in New Issue
Block a user