Update documentation with message queueing stuff

This commit is contained in:
Kristóf Tóth 2018-06-26 16:04:09 +02:00
parent 958b44e570
commit ea5ed41485

View File

@ -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