Class ActionStatus
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trạng thái của hành động
Một lớp đại diện cho trạng thái của yêu cầu gọi hoặc gửi hộp thoại.
Chỉ dành cho ứng dụng Google Chat. Không dùng được cho các tiện ích bổ sung của Google Workspace.
const actionStatus = CardService.newActionStatus()
.setStatusCode(CardService.Status.OK)
.setUserFacingMessage('Success');
Tài liệu chi tiết
setStatusCode(statusCode)
Biểu thị trạng thái của yêu cầu mở hoặc gửi hộp thoại.
const actionStatus = CardService.newActionStatus().setStatusCode(
CardService.Status.OK,
);
Thông số
Tên | Loại | Mô tả |
statusCode | Status | Mã trạng thái. |
Cầu thủ trả bóng
ActionStatus
– Đối tượng này, để tạo chuỗi.
setUserFacingMessage(message)
Thông báo gửi cho người dùng về trạng thái yêu cầu của họ. Nếu không đặt, hệ thống sẽ gửi một thông báo chung dựa trên Status
.
const actionStatus =
CardService.newActionStatus().setUserFacingMessage('Success');
Thông số
Tên | Loại | Mô tả |
message | String | Tin nhắn cần gửi. |
Cầu thủ trả bóng
ActionStatus
– Đối tượng này, để tạo chuỗi.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eActionStatus\u003c/code\u003e is a class used in Google Chat apps to represent the status of dialog requests, such as opening or submitting a dialog.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003esetStatusCode\u003c/code\u003e to indicate the request's success or failure and \u003ccode\u003esetUserFacingMessage\u003c/code\u003e to display a custom message to the user.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this class to provide feedback to users about their interactions with dialogs within Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eThis class is exclusively for Google Chat apps and isn't available for Google Workspace Add-ons.\u003c/p\u003e\n"]]],[],null,["# Class ActionStatus\n\nActionStatus\n\nA class that represents the status for a request to either invoke or submit a dialog.\n\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\n```javascript\nconst actionStatus = CardService.newActionStatus()\n .setStatusCode(CardService.Status.OK)\n .setUserFacingMessage('Success');\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|----------------------------------------------------------------|-------------------|------------------------------------------------------------------------|\n| [setStatusCode(statusCode)](#setStatusCode(Status)) | [ActionStatus](#) | Represents the status for a request to either open or submit a dialog. |\n| [setUserFacingMessage(message)](#setUserFacingMessage(String)) | [ActionStatus](#) | The message to send users about the status of their request. |\n\nDetailed documentation\n----------------------\n\n### `set``Status``Code(statusCode)`\n\nRepresents the status for a request to either open or submit a dialog.\n\n```javascript\nconst actionStatus = CardService.newActionStatus().setStatusCode(\n CardService.Status.OK,\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------------|------------------------------------------------------|------------------|\n| `status``Code` | [Status](/apps-script/reference/card-service/status) | The status code. |\n\n#### Return\n\n\n[ActionStatus](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``User``Facing``Message(message)`\n\nThe message to send users about the status of their request. If unset, a generic message based\non the `Status` is sent.\n\n```javascript\nconst actionStatus =\n CardService.newActionStatus().setUserFacingMessage('Success');\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------|----------|----------------------|\n| `message` | `String` | The message to send. |\n\n#### Return\n\n\n[ActionStatus](#) --- This object, for chaining."]]