SuggestedActions class

Builder class to add suggested actions to a message

Constructors

SuggestedActions(Session)

Creates a new SuggestedActions

Methods

actions(ICardAction[] | IIsCardAction[])

Collection of actions to be displayed as suggested actions.

addAction(ICardAction | IIsCardAction)

Adds an action to be displayed as a suggested action

create(Session, ICardAction[] | IIsCardAction[], string | string[])

Creates a new SuggestedActions

to(TextType)

Optional recipients of the actions. Only supported by certain channels.

toSuggestedActions()

Returns the JSON object for the suggested actions

Constructor Details

SuggestedActions(Session)

Creates a new SuggestedActions

new SuggestedActions(session?: Session)

Parameters

session
Session

(Optional) session object

Method Details

actions(ICardAction[] | IIsCardAction[])

Collection of actions to be displayed as suggested actions.

function actions(list: ICardAction[] | IIsCardAction[])

Parameters

Returns

addAction(ICardAction | IIsCardAction)

Adds an action to be displayed as a suggested action

function addAction(action: ICardAction | IIsCardAction)

Parameters

Returns

create(Session, ICardAction[] | IIsCardAction[], string | string[])

Creates a new SuggestedActions

static function create(session: Session, actions: ICardAction[] | IIsCardAction[], to?: string | string[])

Parameters

session
Session
actions

ICardAction[] | IIsCardAction[]

to

string | string[]

Returns

to(TextType)

Optional recipients of the actions. Only supported by certain channels.

function to(text: TextType)

Parameters

text
TextType

Returns

toSuggestedActions()

Returns the JSON object for the suggested actions

function toSuggestedActions()

Returns