constcard=CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('card title')).build();// Sets the card of the dialog.constdialog=CardService.newDialog().setBody(card);constdialogAction=CardService.newDialogAction().setDialog(dialog);
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/01/30 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/01/30 (UTC)."],[[["`DialogAction` is a builder for creating interactive dialogs within Google Chat apps."],["It allows developers to set the content of the dialog and control its behavior using methods like `setDialog` and `setActionStatus`."],["This functionality is exclusive to Google Chat apps and is not available for Google Workspace Add-ons."],["`DialogAction` uses chaining, meaning methods can be called sequentially to configure the dialog."]]],["This content describes how to build `DialogAction` objects for Google Chat apps. Key actions involve using `CardService` to create a `DialogAction`, setting its content, and specifying its status. The `setDialog(dialog)` method sets the content of the `DialogAction` using a `Dialog` object, which itself can contain a `Card`. The `setActionStatus(actionStatus)` method sets the action's status using an `ActionStatus` object. Both methods allow chaining.\n"]]