Examples of using functions in Voximplant Kit
Functions in Voximplant Kit make it possible to create and program the logic of the bot to perform a specific action. You can find the documentation for the functions here.
Text function example
In the example below, this function will respond to any client message: you wrote: {{text of incoming message}}
If the client writes the queue
command, then the bot will transfer the client's request to the queue.
If the client writes the exit
command, then the bot says goodbye and closes the request.
The function for calls example
In the example below, the function accepts the cmd
variable as input and returns the unknown command
text to the answer
variable.
If cmd = date
, then the function returns the current date to the answer variable.
If cmd = random
, then the function returns a random number from 0 to 10 in the answer variable.