FredrikOseberg / react-chatbot-kit

MIT License
297 stars 139 forks source link

Feature request: Need timestamp for messages #139

Closed ToJen closed 1 year ago

ToJen commented 1 year ago

I would like to use the timestamp of each message for both type bot and user however these are the only attributes that I see in messages in the state when I inspect it:

{
  "delay": undefined,
  "id": 123,
  "loading": false,
  "message": "...",
  "type": "bot|user"
}

It would be helpful to have the full UTC timestamp (in the user's timezone) for both the bot and user messages.

ToJen commented 1 year ago

Keeping track of it myself in the payload of the options sent to createChatbotMessage.

waseemdilsherim commented 2 months ago

what about user message timestamp?

ToJen commented 2 months ago

@waseemdilsherim I don't remember what I did but you can get the timestamp with new Date() or similar just before you handle the user's message.