sendOptions
Sends options to the visitor as a message
Description
vcc.sendOptions(params)
Sends options
Parameters
params
(object) An object containing the following properties:
question
(string): The question to ask the user.options
(array): An array of option objects, each with alabel
(string) and anextAction
(function) that will be called when the option is selected.timeout
(number): The timeout in seconds. If specified, the system will proceed with the timeoutAction action after the timeout expires.timeoutAction
(function): The callback function to be executed after timeout expired.
Return values
none
Example
vcc.sendOptions({
question: "Please choose an option:",
options: [
{ label: "First option", nextAction: handleFirstOption },
{ label: "Second option", nextAction: handleSecondOption }
],
timeout: 30, // Optional: Wait for 30 seconds before timing out
timeoutAction: addToDefaultQueue // Optional: after timeout expired call this function
});
Comments
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.