onConnect event configuration

Hey,I am working on a botkit that translates messages whenever user type in message on chatbot in any language, my botkit is translating each time the user passes the message but i want that the botkit should detect the language of the user ,only when the user send the first message to the bot, and after that the bot should converse in the same language with the user,
And i want to use OnConnect functionality of the event trigger of the botkit, so please help me with the syntax of the same

Dear Mridul,

  1. On the Bot Builder from the Navigation Panel go to Settings -> Config Settings -> Language Management .
  2. On the Language Management window, click Enable next to the language you want to.
  3. Under the Language Selection Time Frame (scroll down to view this option) select one of these options:
  • Lifetime: Set as the user’s preferred language forever or until the user chooses to switch languages

  • Per Session: Re-detect the utterance language at the beginning of every session.

  • Every User Message: Identify language from every user message and use it as the user’s preferred language until a new language is identified from the user input.

image

Note : If the language cannot be determined with high confidence, bot requests the users to select their preferred language. The default language is used to communicate with the user during language preference selection.
4. Click Save .

Further, On connect event applies ONLY for Web/Mobile SDK channel and takes precedence over the Welcome event of both are configured.

You may follow our document link that talks about configuring the Events for the BotKit SDK:

https://developer.kore.ai/docs/bots/sdks/using-the-botkit-sdk/

https://developer.kore.ai/docs/bots/sdks/sdk-events/

Hope this helps.

Thanks & Regards,
Kore.ai Technical Support Team