0

Im using this workspace https://github.com/twilio/twilio-webchat-react-app that is connect with studio. I would like to know how can i apply delay on each message displayed in the chat via code, i tried several ways to apply delay, and i applied delay, but only when the "bot" send one message, the issue is that when the bot send more than one message, the delay is aplied in all the message instead os each message at a time. Is there a certain place that i have to put a setTimeout for each time that the Array of message push a message? I know that i can put delay in studio with the Widget run function, but in a huge flow with many send messages to be delayed, would take a lot of time to make the connections and a lot more “mess” to deal, and by code would be much more practical.

I was working on these files: MessageBubble.tsx and MessageList.tsx.

I tried to put an boolean variable on a setTimeout if the message has an attribute 'delay' would be true and after the timeout would change to false, and according to that variable the display os the MessageBubble would be conditioned by this variable, but only applies when its only one message, not an group of send messages, if its a group, the display would be delayed, but when the display change to 'flex' it shows all the group of messages that the bot sent instaed of each message at a time.

0 Answers0