How to Start a Task immediately when we open chat window

channel

(Srirama Yadlapalli) #1

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.

Select the intent programatically during initialisation of the bot.
Initialize data in bot on welcome message
(Subrahmanyam Donepudi) #2

@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.

Please refer to the below link for more details:

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