Edit

Share via


PlayPromptAction class

Action builder class designed to simplify building playPrompt actions.

Constructors

PlayPromptAction(CallSession)

Creates a new instance of the action builder.

Methods

file(CallSession, string)

Creates a file prompt that will be played to the user.

prompts(IPrompt[] | IIsPrompt[])

List of prompts to play out with each single prompt object.

silence(CallSession, number)

Creates a prompt that plays silence to the user.

text(CallSession, string | string[], any[])

Creates a text prompt that will be spoken to the user using TTS.

toAction()

Returns the JSON object for the action.

Constructor Details

PlayPromptAction(CallSession)

Creates a new instance of the action builder.

new PlayPromptAction(session?: CallSession)

Parameters

session
CallSession

Method Details

file(CallSession, string)

Creates a file prompt that will be played to the user.

static function file(session: CallSession, uri: string)

Parameters

session
CallSession
uri

string

Returns

prompts(IPrompt[] | IIsPrompt[])

List of prompts to play out with each single prompt object.

function prompts(list: IPrompt[] | IIsPrompt[])

Parameters

list

IPrompt[] | IIsPrompt[]

Returns

silence(CallSession, number)

Creates a prompt that plays silence to the user.

static function silence(session: CallSession, time: number)

Parameters

session
CallSession
time

number

Returns

text(CallSession, string | string[], any[])

Creates a text prompt that will be spoken to the user using TTS.

static function text(session: CallSession, text: string | string[], args: any[])

Parameters

session
CallSession
text

string | string[]

args

any[]

Returns

toAction()

Returns the JSON object for the action.

function toAction()

Returns