Class DialogAction

DialogAction

A builder for DialogAction objects.

Only available for Google Chat apps. Not available for Google Workspace Add-ons.

const card = CardService.newCardBuilder()
                 .setHeader(CardService.newCardHeader().setTitle('Card title'))
                 .build();
const dialog = CardService.newDialog().setBody(card);

const dialogAction = CardService.newDialogAction().setDialog(dialog);

Methods

MethodReturn typeBrief description
setActionStatus(actionStatus)DialogActionSets the action status of DialogAction.
setDialog(dialog)DialogActionSets the dialog of the DialogAction.

Detailed documentation

setActionStatus(actionStatus)

Sets the action status of DialogAction.

const actionStatus = CardService.newActionStatus().setStatusCode(
    CardService.Status.OK,
);

const dialogAction =
    CardService.newDialogAction().setActionStatus(actionStatus);

Parameters

NameTypeDescription
actionStatusActionStatusThe ActionStatus to use.

Return

DialogAction — This object, for chaining.


setDialog(dialog)

Sets the dialog of the DialogAction.

const card = CardService.newCardBuilder()
                 .setHeader(CardService.newCardHeader().setTitle('card title'))
                 .build();

// Sets the card of the dialog.
const dialog = CardService.newDialog().setBody(card);

const dialogAction = CardService.newDialogAction().setDialog(dialog);

Parameters

NameTypeDescription
dialogDialogThe Dialog to use.

Return

DialogAction — This object, for chaining.