Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chat history Persistence in MicroSoft Botframework WebChat window

Tags:

botframework

I have a requirement of maintaining chat history and loading them back in a window after a page refresh or close and opening of the window.

ISSUE : Buttons/carousel/Adaptive cards/Hero Cards events/ properties are not loading (ie; when I click on button or any event, actions are not happening). DESCRIPTION: In order to achieve the requirement i had 2 options.

BotFramework _ Directline JS I guess using this we can only get conversation history and where we couldn't load back the conversation history in chat window. Though we can get the conversation history we have to send all the messages to bot again. So i had opted 2nd one.

Store the html controls and Load it in the bot div: When sending or receiving message action is happening from bot am storing the html controls(i.e; controls under wc-message-groups class in local storage) and binding back to the div on page load if data exists. This works for me to show conversation history in a chat window. But I am not able to get the events/actions for buttons.

Can we do this with Directline JS or is there any option to load properties/events to controls? Please help me with this issue.

Thanks in Advance

like image 273
Janardhan Goud Avatar asked Dec 19 '25 04:12

Janardhan Goud


1 Answers

I would start by taking a look at this thread out the Webchat GitHub repo. There is a good discussion going on about how this may be accomplished.

I also created this project in C# using webchat which will provide chat history in the webchat control. The project uses this pull request branch which you would also need to use. Hope this helps, good luck.

like image 91
D4RKCIDE Avatar answered Dec 22 '25 03:12

D4RKCIDE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!