Class Dialog
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Dialog
Weitere Informationen finden Sie in der Google Chat-Dokumentation unter Interaktive Dialoge öffnen.
Ein Builder für Dialog
-Objekte.
Nur für Google Chat-Apps verfügbar. Nicht verfügbar für Google Workspace-Add-ons.
const card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.build();
// Sets the card of the dialog.
const dialog = CardService.newDialog().setBody(card);
Detaillierte Dokumentation
setBody(card)
Legt die Karte des Dialog
fest.
const card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.build();
// Sets the card of the dialog.
const dialog = CardService.newDialog().setBody(card);
Parameter
Name | Typ | Beschreibung |
card | Card | Der zu verwendende Card . |
Rückflug
Dialog
– dieses Objekt, zur Verkettung
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
[null,null,["Zuletzt aktualisiert: 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."]]