Class ActionStatus
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
DziałanieStan
Klasa reprezentująca stan żądania wywołania lub przesłania dialogu.
Dostępne tylko w przypadku aplikacji Google Chat. Niedostępne w przypadku dodatków Google Workspace.
const actionStatus = CardService.newActionStatus()
.setStatusCode(CardService.Status.OK)
.setUserFacingMessage('Success');
Szczegółowa dokumentacja
setStatusCode(statusCode)
Stan prośby o otwarcie lub przesłanie okna.
const actionStatus = CardService.newActionStatus().setStatusCode(
CardService.Status.OK,
);
Parametry
Nazwa | Typ | Opis |
statusCode | Status | Kod stanu. |
Powrót
ActionStatus
– ten obiekt do łańcucha.
setUserFacingMessage(message)
Wiadomość, która ma być wysyłana do użytkowników o stanie ich prośby. Jeśli nie zostanie ustawiony, zostanie wysłana ogólna wiadomość na podstawie Status
.
const actionStatus =
CardService.newActionStatus().setUserFacingMessage('Success');
Parametry
Nazwa | Typ | Opis |
message | String | Wiadomość do wysłania. |
Powrót
ActionStatus
– ten obiekt do łańcucha.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 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."]]