react-chatbot-kit icon indicating copy to clipboard operation
react-chatbot-kit copied to clipboard

How can I access to the history chat?

Open CMara14 opened this issue 1 year ago • 1 comments

I'm trying to use the message history so that depending on the last message, perform a certain action, but I'm not finding a way to access it.

CMara14 avatar Aug 17 '23 14:08 CMara14

Hello. I don't know if this is the "best" way to extract the messages but I found that I can access the messages in the children prop sent to the MessageParser component that you need to provide. You can then access the messages using children?.props?.state?.messages. I've been doing this to send the messages through to a function in my ActionProvider component as I too need to see the history to determine the response.

greendinosaur avatar Sep 11 '23 17:09 greendinosaur