Enum ResponseType
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
回應類型
列舉代表 Chat 應用程式回應類型。
僅適用於 Google Chat 應用程式。不適用於 Google Workspace 外掛程式。
如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如
CardService.Type.DIALOG
。
屬性
屬性 | 類型 | 說明 |
TYPE_UNSPECIFIED | Enum | 以 NEW_MESSAGE 處理的預設類型。 |
NEW_MESSAGE | Enum | 在主題中發布新訊息。 |
UPDATE_MESSAGE | Enum | 更新 Chat 應用程式的訊息。這項操作僅適用於訊息傳送者類型為 BOT 的 CARD_CLICKED 事件。 |
UPDATE_USER_MESSAGE_CARDS | Enum | 更新使用者訊息中的資訊卡。這項操作僅適用於回應含有相符網址的 MESSAGE 事件,或是訊息傳送者類型為 HUMAN 的 CARD_CLICKED 事件。系統會忽略文字。 |
REQUEST_CONFIG | Enum | 私下要求使用者進行額外驗證或設定。 |
DIALOG | Enum | 顯示對話方塊。 |
UPDATE_WIDGET | Enum | 小工具文字自動完成選項查詢。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eResponseType\u003c/code\u003e is an enum used to define the type of response a Google Chat app sends.\u003c/p\u003e\n"],["\u003cp\u003eIt is exclusively for Google Chat apps and is not applicable to Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eResponseType\u003c/code\u003e properties specify actions like posting new messages, updating existing ones, requesting user configuration, and displaying dialogs.\u003c/p\u003e\n"],["\u003cp\u003eUpdating cards on user messages or the Chat app's message depends on specific event triggers and sender types.\u003c/p\u003e\n"],["\u003cp\u003eTo call an enum property, use its parent class, name, and the specific property (e.g., \u003ccode\u003eCardService.Type.DIALOG\u003c/code\u003e).\u003c/p\u003e\n"]]],["The `ResponseType` enum defines how a Google Chat app responds. Available responses include `NEW_MESSAGE` (post a new message), `UPDATE_MESSAGE` (update the app's message, only for bot-initiated events), and `UPDATE_USER_MESSAGE_CARDS` (update cards on a user's message for human or URL-matched events). Other options: `REQUEST_CONFIG` (ask for user config), `DIALOG` (present a dialog), `UPDATE_WIDGET` (widget autocomplete query), and the default `TYPE_UNSPECIFIED` which is handled as `NEW_MESSAGE`.\n"],null,["# Enum ResponseType\n\nResponseType\n\nAn enum that represents the type of Chat app response.\n\nOnly available for Google Chat apps. Not available for Google Workspace add-ons.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.Type.DIALOG`. \n\n### Properties\n\n| Property | Type | Description |\n|-----------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `TYPE_UNSPECIFIED` | `Enum` | Default type that's handled as `NEW_MESSAGE`. |\n| `NEW_MESSAGE` | `Enum` | Post as a new message in the topic. |\n| `UPDATE_MESSAGE` | `Enum` | Update the Chat app's message. This is only permitted on a `CARD_CLICKED` event where the message sender type is `BOT`. |\n| `UPDATE_USER_MESSAGE_CARDS` | `Enum` | Update the cards on a user's message. This is only permitted as a response to a `MESSAGE` event with a matched URL, or a `CARD_CLICKED` event where the message sender type is `HUMAN`. Text is ignored. |\n| `REQUEST_CONFIG` | `Enum` | Privately ask the user for additional authentication or configuration. |\n| `DIALOG` | `Enum` | Presents a dialog. |\n| `UPDATE_WIDGET` | `Enum` | Widget text autocomplete options query. |"]]