Adding custom delay depending on length of previous response in Rasa Webchat

Hi @nik202,
thanks for asking! I was busy implementing some new features. So I didn’t have so muc time to try it out. So far I couldn’t make it work. I added the solution suggested by Chris Rahme

					let m1 = null,
					customMessageDelay: (message) => {
					let delay = (m1 ? m1 : message.length) * 30;
                    if (delay > 6000) delay = 6000;
                    if (delay < 100) delay = 1000;
					m1 ? m1 : message.length;
                    return delay;},

to my code. However, then it brakes completly. I do not know JavaScript, therefore I am stuck right now.

My idea was to delay the messages from the bot according to the length of the message posted before. Because, if the bot answers in three bubbles and the first is very short, then the user won’t need so much time to read it. The second bubble could then be posted with only a short delay. If the second bubble, e.g. is very long, then the third bubble should be delayed more, in order for the user to have enough time to read the second bubble…
Does it make sense to you? You have seen our prototype, we provide a lot of information inside the bot already before guiding the user to the website…
Ciao, Vio