Class ChatActionResponse
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
채팅조치응답
Chat 앱에서 응답 게시 방법을 구성하는 데 사용할 수 있는 매개변수를 나타내는 클래스입니다.
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);
const chatActionResponse = CardService.newChatActionResponse()
.setResponseType(CardService.Type.DIALOG)
.setDialogAction(dialogAction);
자세한 문서
setDialogAction(dialogAction)
대화상자 작업을 대화상자와 관련된 이벤트로 설정합니다.
const card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader().setTitle('Card title'))
.build();
const dialog = CardService.newDialog().setBody(card);
const dialogAction = CardService.newDialogAction().setDialog(dialog);
const chatActionResponse = CardService.newChatActionResponse()
.setResponseType(CardService.Type.DIALOG)
.setDialogAction(dialogAction);
매개변수
리턴
ChatActionResponse
: 연결을 위한 객체입니다.
setResponseType(responseType)
Chat 앱 응답 유형입니다.
const chatActionResponse = CardService.newChatActionResponse().setResponseType(
CardService.Type.DIALOG,
);
매개변수
리턴
ChatActionResponse
: 연결을 위한 객체입니다.
setUrl(url)
사용자가 인증하거나 구성할 수 있는 URL입니다. REQUEST_CONFIG
응답 유형에만 해당합니다.
const chatActionResponse = CardService.newChatActionResponse()
.setResponseType(CardService.Type.REQUEST_CONFIG)
.setUrl('https://www.google.com');
매개변수
이름 | 유형 | 설명 |
url | String | 전송할 URL입니다. |
리턴
ChatActionResponse
: 연결을 위한 객체입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003e\u003ccode\u003eChatActionResponse\u003c/code\u003e allows Google Chat apps to configure how their responses are displayed, including dialogs, widgets, and URLs.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides methods like \u003ccode\u003esetDialogAction\u003c/code\u003e, \u003ccode\u003esetResponseType\u003c/code\u003e, \u003ccode\u003esetUpdatedWidget\u003c/code\u003e, and \u003ccode\u003esetUrl\u003c/code\u003e to customize the response behavior.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eChatActionResponse\u003c/code\u003e is exclusively for Google Chat apps and is not supported in Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003eEach method within \u003ccode\u003eChatActionResponse\u003c/code\u003e returns the object itself, enabling method chaining for streamlined configuration.\u003c/p\u003e\n"]]],["The `ChatActionResponse` class configures how a Chat app's response is posted, specifically for Google Chat apps. Key actions include setting the response type, which can be a dialog, updating a widget, or requesting configuration. The `setDialogAction` method links an event to a dialog. `setUpdatedWidget` provides autocomplete options, while `setUrl` directs users to a specific URL, mainly for authentication or configuration requests. Each method returns a `ChatActionResponse` object, enabling method chaining.\n"],null,["# Class ChatActionResponse\n\nChatActionResponse\n\nA class that represents the parameters that a Chat app can use to configure how its response is\nposted.\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\nconst chatActionResponse = CardService.newChatActionResponse()\n .setResponseType(CardService.Type.DIALOG)\n .setDialogAction(dialogAction);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------|-------------------------|-----------------------------------------------------------------------------|\n| [setDialogAction(dialogAction)](#setDialogAction(DialogAction)) | [ChatActionResponse](#) | Sets the dialog action to an event related to a dialog. |\n| [setResponseType(responseType)](#setResponseType(ResponseType)) | [ChatActionResponse](#) | The type of Chat app response. |\n| [setUpdatedWidget(updatedWidget)](#setUpdatedWidget(UpdatedWidget)) | [ChatActionResponse](#) | Sets the updated widget, used to provide autocomplete options for a widget. |\n| [setUrl(url)](#setUrl(String)) | [ChatActionResponse](#) | The URL for users to authenticate or configure. |\n\nDetailed documentation\n----------------------\n\n### `set``Dialog``Action(dialogAction)`\n\nSets the dialog action to an event related to a dialog.\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\nconst chatActionResponse = CardService.newChatActionResponse()\n .setResponseType(CardService.Type.DIALOG)\n .setDialogAction(dialogAction);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|------------------|-------------------------------------------------------------------|---------------------------|\n| `dialog``Action` | [DialogAction](/apps-script/reference/card-service/dialog-action) | The dialog action to set. |\n\n#### Return\n\n\n[ChatActionResponse](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Response``Type(responseType)`\n\nThe type of Chat app response.\n\n```javascript\nconst chatActionResponse = CardService.newChatActionResponse().setResponseType(\n CardService.Type.DIALOG,\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|------------------|-------------------------------------------------------------------|--------------------|\n| `response``Type` | [ResponseType](/apps-script/reference/card-service/response-type) | The response type. |\n\n#### Return\n\n\n[ChatActionResponse](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Updated``Widget(updatedWidget)`\n\nSets the updated widget, used to provide autocomplete options for a widget.\n\n```javascript\nconst updatedWidget =\n CardService.newUpdatedWidget()\n .addItem(\n 'Contact 1',\n 'contact-1',\n false,\n 'https://www.gstatic.com/images/branding/product/2x/contacts_48dp.png',\n 'Contact one description',\n )\n .addItem(\n 'Contact 2',\n 'contact-2',\n false,\n 'https://www.gstatic.com/images/branding/product/2x/contacts_48dp.png',\n 'Contact two description',\n )\n .addItem(\n 'Contact 3',\n 'contact-3',\n false,\n 'https://www.gstatic.com/images/branding/product/2x/contacts_48dp.png',\n 'Contact three description',\n )\n .addItem(\n 'Contact 4',\n 'contact-4',\n false,\n 'https://www.gstatic.com/images/branding/product/2x/contacts_48dp.png',\n 'Contact four description',\n )\n .addItem(\n 'Contact 5',\n 'contact-5',\n false,\n 'https://www.gstatic.com/images/branding/product/2x/contacts_48dp.png',\n 'Contact five description',\n );\n\nconst actionResponse =\n CardService.newChatActionResponse()\n .setUpdatedWidget(updatedWidget)\n .setResponseType(CardService.ResponseType.UPDATE_WIDGET);\n```\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------------|---------------------------------------------------------------------|-------------------------------|\n| `updated``Widget` | [UpdatedWidget](/apps-script/reference/card-service/updated-widget) | The updated widget to be set. |\n\n#### Return\n\n\n[ChatActionResponse](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Url(url)`\n\nThe URL for users to authenticate or configure. Only for the `REQUEST_CONFIG` response\ntype.\n\n```javascript\nconst chatActionResponse = CardService.newChatActionResponse()\n .setResponseType(CardService.Type.REQUEST_CONFIG)\n .setUrl('https://www.google.com');\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|-------|----------|------------------|\n| `url` | `String` | The URL to send. |\n\n#### Return\n\n\n[ChatActionResponse](#) --- This object, for chaining."]]