ใช้ได้กับแอป Google Chat เท่านั้น ไม่พร้อมใช้งานสำหรับส่วนเสริมของ Google Workspace
constcard=CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('Card title')).build();// Sets the card of the dialog.constdialog=CardService.newDialog().setBody(card);
constcard=CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('Card title')).build();// Sets the card of the dialog.constdialog=CardService.newDialog().setBody(card);
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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."]]