Class Dialog
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Dialog
Per maggiori dettagli, vedi Aprire dialoghi interattivi nella documentazione di Google Chat.
Un generatore di oggetti Dialog
.
Disponibile solo per le app Google Chat. Non disponibile per i componenti aggiuntivi di Google Workspace.
const card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.build();
// Sets the card of the dialog.
const dialog = CardService.newDialog().setBody(card);
Documentazione dettagliata
setBody(card)
Imposta la scheda del Dialog
.
const card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.build();
// Sets the card of the dialog.
const dialog = CardService.newDialog().setBody(card);
Parametri
Nome | Tipo | Descrizione |
card | Card | Il Card da utilizzare. |
Invio
Dialog
: questo oggetto, per l'accodamento.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eDialog\u003c/code\u003e helps you create interactive dialogs within Google Chat apps for displaying information or gathering input.\u003c/p\u003e\n"],["\u003cp\u003eIt's exclusively for Google Chat apps and not available for Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003eThe core functionality involves setting a card, built using \u003ccode\u003eCardService\u003c/code\u003e, as the body of the dialog to present content to the user.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esetBody()\u003c/code\u003e method is key to setting the card within the dialog and supports chaining for further configurations.\u003c/p\u003e\n"]]],[],null,["# Class Dialog\n\nDialog\n\nFor details, see [Open interactive\ndialogs](https://developers.google.com/chat/how-tos/dialogs) in the Google Chat documentation.\n\nA builder for [Dialog](#) objects.\n\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\n```javascript\nconst card = CardService.newCardBuilder()\n .setHeader(CardService.newCardHeader().setTitle('Card title'))\n .build();\n\n// Sets the card of the dialog.\nconst dialog = CardService.newDialog().setBody(card);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------|-------------|--------------------------------|\n| [setBody(card)](#setBody(Card)) | [Dialog](#) | Sets the card of the `Dialog`. |\n\nDetailed documentation\n----------------------\n\n### `set``Body(card)`\n\nSets the card of the `Dialog`.\n\n```javascript\nconst card = CardService.newCardBuilder()\n .setHeader(CardService.newCardHeader().setTitle('Card title'))\n .build();\n\n// Sets the card of the dialog.\nconst dialog = CardService.newDialog().setBody(card);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|--------------------------------------------------|--------------------------------------------------------------|\n| `card` | [Card](/apps-script/reference/card-service/card) | The [Card](/apps-script/reference/card-service/card) to use. |\n\n#### Return\n\n\n[Dialog](#) --- This object, for chaining."]]