How to let bot start the conversation

hi @Asmacats, In my case what I had done was:

  • I had written a custom action that will send the greeting message
  • then I had configured the event i.e whenever the user will open the chatbot widget(webpage), I am sending an event to the bot that will trigger the custom actions and it will greet the user

attaching the sample code for your references:

actions.py file image

make sure you return the action with UserUtteranceReverted()event, so that it won’t affect the conversation flow

script.js file(this is the custom webpage widget build using jquery)

here If you see while calling the REST api, I am passing the user_id as the conversation_id

output:

image

Hope this helps you :wink:

2 Likes