Deprecated functions are still supported; however, bot developers are encouraged to use stated alternatives instead.

Get channel

getChannel is deprecated but supported. Bot developers are encouraged to use getUserChannel instead.

Returns the platform channel the user is currently communicating on. This function returns - lp_sms, lp_web, lp_inapp, sms, web, inapp. lp_ prefix indicates the LivePerson platform.

Function Name Arguments Returns
getChannel() None lp_sms, lp_web, lp_inapp, sms, web, inapp

Example

var channel = botContext.getChannel();
botContext.printDebugMessage("channel used by the user is: " + channel);

Add quick reples

addQuickReples is deprecated but supported. Bot developers are encouraged to use addQuickReplies instead.

The Add Quick Reples function is used for adding quick replies to a message in JavaScript rather than defining in bot creation. This allows for the dynamic addition of the buttons to accommodate various scenarios.

Function Name Arguments Returns
addQuickReples() array None

Example

The example below shows how quick replies can be added easily to your message.

// Add these quick replies to an existing message
botContext.addQuickReples(['Ranch~sauce01','Honey Mustard~sauce02','BBQ~sauce03','Hot~sauce04']);