mirror of
				https://github.com/avatao-content/frontend-tutorial-framework
				synced 2025-11-04 08:52:56 +00:00 
			
		
		
		
	Update documentation with message queueing stuff
This commit is contained in:
		
							
								
								
									
										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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user