how set default welcome message for Bot ?
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)
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:
-
Create utter_welcome_message utterance in your domain file. And give whatever intial message you wants to display.
-
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.
-
Add simple story in your story file for the specified intent and call action as utter_welcome_message.
-
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
Hey Prashant,
Thanks for your reply. We are using rocket.chat. Do you know how to use payload there.
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.
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
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â ?