Show message time in RASA chatbot widget

Hello, I am using this widget (https://github.com/JiteshGaikwad/Chatbot-Widget) and I want to show “message time” with each message sent by the user/bot. How can I achieve that please help?

I want this functionality with this widget.

Hi! :grinning: You can. This is a very hackable widget. But you will need to make some codes changes

In this file “chat.js” https://github.com/JiteshGaikwad/Chatbot-Widget/blob/main/static/js/components/chat.js#L16 Change this line

const user_response = `<img class="userAvatar" src='./static/img/userAvatar.jpg'>
<p class="userMsg">${message} </p><div class="clearfix"></div>`;

to:

const today= new Date().toLocaleString('en-US', { timeZone: 'UTC' });

const user_response = `<img class="userAvatar" src='./static/img/userAvatar.jpg'>
<p class="userMsg">${message} <span>${today}</span> </p><div class="clearfix"></div>`;

Do the same thing for other lines with “BotResponse” variable in this same file :grinning:

@itsjhonny Thanks for the response. I’ll try this solution.