Thanks Chris and Vio. I borrowed this code for a project.
One question - this also seems to delay the first bot message based on the length of the bot message prior to the previous user message. It feels like the ideal functionality for each user message would be for the first bot message to appear without much delay, and then subsequent bot messages to be delayed based on length of the last bot message so the user has time to read them. Did you find the same Vio? Sounds like it would need changes on webchat side to achieve that though.