How to Start a Task immediately when we open chat window

You can achieve this requirement using Kore WebSDK.

  1. In the Kore WebSDK folder, in kore-bot-sdk-client file, under onOpenWSConnection function, we need to write the below code to send a message to the bot from WebSDK.

var message = {
“message”: {
“body”: “App cant find lights”(Dialog Name)
},
“resourceid”: “/bot.message”
}
window.currKotrebotInstance = this;
setTimeout(function(){window.currKotrebotInstance.sendMessage(message)},2000);

  1. Now save the file and open Index.html file. We can see the triggered dialog as when the chat window opens.
1 Like

@srirama.yadlapalli With the implementation of events under extensions on bot builder, developer need not have to send a message to invoke the dialog from the web SDK. Instead, the developer could use the On connect event to have the functionality achieved.
Additionally, the platform now also offers welcome event which would respond based on the first message from user.

Bots platform also offers the option to invoke dialog, run a script or show message in case of events On connect and Welcome.

image

image

Please refer to the below link for more details:

https://developer.kore.ai/docs/bots/kore-web-sdk/event-based-bot-actions/

PS: “Welcome message” which was previously under the bot settings should also be managed from these events here onwards.

1 Like

Hi @Subrahmanyam,

We have to implement a similar feature but dont see the “Events” available in 6.2.3 version we are using.

Can you please suggest how can we achieve this efficiently in 6.2.3 ?

Thanks

@janak.jay we strongly recommend upgrading to newer versions. We are not supporting 6.2.3.