Default welcome message

how set default welcome message for Bot ?

1 Like

It’ll depend on the chat you are using. For my project, we have the control over the chat, so we are going to send a /welcome message/intent so the bot will respond with the welcome intent without interaction from the user.

But there is not standard way to do this, it depends on your chat platform.

@huberrom can you please elaborate on how to perform this task.

Thanks in advance

Well, I have an intent which is name “bienvenue” (welcome in french), with the following story :

## story_bienvenue
* bienvenue
    - action_bienvenue

When the chat open, it sends this to the bot :

{ "message" : "/bienvenue"}

(if you don’t use the last version of rasa core, it would be query instead of message)

1 Like

Can you share more details here, I am still struggling with it, thanks

Hi @rasalearner if you are using mrbot-ai/ rasa-webchat then in that case I can help you upto some extent.

Below are the steps I followed to display welcome message when bot loads:

  1. Create utter_welcome_message utterance in your domain file. And give whatever intial message you wants to display.

  2. Also add one intent with the name of your choice in your domain file. In my case I have ‘hello’ as intent. Also don’t forget to include this utter_welcome_message in your action’s list i.e in domain file.

  3. Add simple story in your story file for the specified intent and call action as utter_welcome_message.

  4. In your html file put initPayload value with intent that you have created for e.g in my case it is

    initPayload: "/hello",

If it helps let me know pal :slightly_smiling_face::slightly_smiling_face:

3 Likes

Hey Prashant,

Thanks for your reply. We are using rocket.chat. Do you know how to use payload there.

1 Like

Hi Nitin,

I have not used rocket chat yet. But can you show me what you are upto or what have you done.

So what I am asking is how to trigger initPayload: “/hello”, in rocket.chat client so that default welcome message appears there. Currently I am only asking user to chat first and then welcome message appears. In this case sometimes user doesn’t do proper greeting as expected hence trigger doesn’t work. So we want welcome message first to force some default happy paths.

1 Like

hii @prashant_kamble, which html file are you talking about ?

Hi @Saurbh060,

HTML means I am talking about javascript file from which we are calling rasa core webhook API.

ohh thanks

Yup :blush:

can you please give more details on how to send the http request? How can I know who to send the request to?

If you have started both the rasa servers on your local host, that is the action server and the rasa server, then they are by default running on ports 5055 and 5005 respectively. You can do a POST request to the url localhost:5005/webhooks/rest/webhook. Keep in mind for this to work, you need to be using the REST channel as the medium for communication.

Hope that helps.

thanks

Thanks , It hepled me.

hey @prashant_kamble I did use your steps but my bot isnt sending anything at start. I included this code in my html page and followed your 4 steps,but thee bot waits for me to initiate conversation.

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
// Or you can replace latest with a specific version
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/hello",
    customData: {"language": "en"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5005",
    socketPath: "/socket.io/",
    title: "Title",
    subtitle: "Subtitle",
  })
</script

Hi @pranay_raj,

Have you created corresponding intent like as I have mentioned i.e /hello intent??

@prashant_kamble yes i have created a intent 'hello 'and followed all 4 steps of yours. Does it need to be ‘/hello’ ?