how to make the session starts with the bot response in dialogflow CX

Hi,
 I need the bot to start the conversation first with the user name(xxx) that was captured from the account they are signed in the website "Hi xxx, How can I help you today?" without any user intent like "hi". How to make that possible in dialogflow CX?  The conversation will starts with bot response. But the session time starts only after the user input.

For example:
Conversation starts..
Bot: Hi xxxx, How can I help you today?
(The session should not starts from this. Until the next response from the user comes, the session should be idle.)
User: Hi, I need help on solving the error on my code.
(the session should start at the moment once the user response came)

How can we achieve this two cases?
1) Start with bot response with account name
2) Session starts only when the user types something.

Thanks in advance


5 1 94
1 REPLY 1

Hi,

To do that you will need to use the webchat functions to inject messages in the chatbot when some events happen: https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger/javascript-even...

If you want to also call dialogflow CX backend you will need to call the detectInent method when the webchat is loaded: https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger/javascript-func...

best,

Xavi