Closed littlepenguin89106 closed 2 months ago
Hi @littlepenguin89106. Please see the following issue where this question was already answered: https://github.com/OvidijusParsiunas/deep-chat/issues/143
Thanks!
I think its behaviour is different, because it doesn't trigger the onNewMessage
event.
The onNewMessage
has no relevance to how the messages are displayed. You need to use the messageStyles
property to set the styling as described in this comment.
If your question is different, please elaborate. Thankyou.
Thanks for replies, I try to implement two requirements:
Deep Chat does not provide the ability to have dynamic properties, so messageStyles
can't be changed depending on the button that you clicked.
The only advice I can offer here is instead of using submitUserMessage
for button2 - you should try to use the _addMessage
method. This is a method that is not part of our official documentation and will be added to the main API on our next release, however it is still available in the current release. The way it works is it accepts a Response
object as an argument and adds a message to the chat. E.g. deepChatRef._addMessage({text: 'hello'});
.
The way you can use this in your use-case is you can process the request yourself on button2 click and then add the result to the chat via _addMessage
. Hopefully this helps you.
Got it! Thank you for the timely support.
When I use
submitUserMessage
, the request is shown on the chat. How do I only show the response?