Class DialogAction
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
डायलॉगऐक्शन
DialogAction
ऑब्जेक्ट के लिए बिल्डर.
यह सुविधा सिर्फ़ Google Chat ऐप्लिकेशन के लिए उपलब्ध है. Google Workspace के ऐड-ऑन के लिए उपलब्ध नहीं है.
const card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.build();
const dialog = CardService.newDialog().setBody(card);
const dialogAction = CardService.newDialogAction().setDialog(dialog);
ज़्यादा जानकारी वाला दस्तावेज़
setActionStatus(actionStatus)
DialogAction
की कार्रवाई की स्थिति सेट करता है.
const actionStatus = CardService.newActionStatus().setStatusCode(
CardService.Status.OK,
);
const dialogAction =
CardService.newDialogAction().setActionStatus(actionStatus);
पैरामीटर
वापसी का टिकट
DialogAction
— चेन करने के लिए यह ऑब्जेक्ट.
setDialog(dialog)
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);
पैरामीटर
वापसी का टिकट
DialogAction
— चेन करने के लिए यह ऑब्जेक्ट.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eDialogAction\u003c/code\u003e is a builder for creating interactive dialogs within Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eIt allows developers to set the content of the dialog and control its behavior using methods like \u003ccode\u003esetDialog\u003c/code\u003e and \u003ccode\u003esetActionStatus\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis functionality is exclusive to Google Chat apps and is not available for Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDialogAction\u003c/code\u003e uses chaining, meaning methods can be called sequentially to configure the dialog.\u003c/p\u003e\n"]]],["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"],null,["# Class DialogAction\n\nDialogAction\n\nA builder for [DialogAction](#) 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();\nconst dialog = CardService.newDialog().setBody(card);\n\nconst dialogAction = CardService.newDialogAction().setDialog(dialog);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------------|-------------------|---------------------------------------------|\n| [setActionStatus(actionStatus)](#setActionStatus(ActionStatus)) | [DialogAction](#) | Sets the action status of `Dialog``Action`. |\n| [setDialog(dialog)](#setDialog(Dialog)) | [DialogAction](#) | Sets the dialog of the `Dialog``Action`. |\n\nDetailed documentation\n----------------------\n\n### `set``Action``Status(actionStatus)`\n\nSets the action status of `Dialog``Action`.\n\n```javascript\nconst actionStatus = CardService.newActionStatus().setStatusCode(\n CardService.Status.OK,\n);\n\nconst dialogAction =\n CardService.newDialogAction().setActionStatus(actionStatus);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|------------------|-------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| `action``Status` | [ActionStatus](/apps-script/reference/card-service/action-status) | The [ActionStatus](/apps-script/reference/card-service/action-status) to use. |\n\n#### Return\n\n\n[DialogAction](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Dialog(dialog)`\n\nSets the dialog of the `Dialog``Action`.\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\nconst dialogAction = CardService.newDialogAction().setDialog(dialog);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|------------------------------------------------------------------|\n| `dialog` | [Dialog](/apps-script/reference/card-service/dialog) | The [Dialog](/apps-script/reference/card-service/dialog) to use. |\n\n#### Return\n\n\n[DialogAction](#) --- This object, for chaining."]]