SuggestedActions class
Builder class to add suggested actions to a message
Constructors
Suggested |
Creates a new SuggestedActions |
Methods
actions(ICard |
Collection of actions to be displayed as suggested actions. |
add |
Adds an action to be displayed as a suggested action |
create(Session, ICard |
Creates a new SuggestedActions |
to(Text |
Optional recipients of the actions. Only supported by certain channels. |
to |
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
- list
-
ICardAction[] | IIsCardAction[]
Returns
addAction(ICardAction | IIsCardAction)
Adds an action to be displayed as a suggested action
function addAction(action: ICardAction | IIsCardAction)
Parameters
- action
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()