EventType
列舉 |
UNSPECIFIED |
整數清單的預設值。請勿使用。 |
MESSAGE |
使用者傳送訊息給 Chat 應用程式,或在聊天室中叫用 Chat 應用程式,例如下列任一例子:
- Chat 應用程式即時訊息 (DM) 聊天室中的任何訊息。
- 在多人聊天室中,有人在訊息中 @提及 Chat 應用程式,或使用其中一個 斜線指令。
- 如果您已為 Chat 應用程式設定連結預覽功能,使用者發布含有連結的訊息時,系統會比對該連結是否符合所設定的網址模式。
|
ADDED_TO_SPACE |
使用者將 Chat 應用程式新增至聊天室,或是 Google Workspace 管理員在即時訊息聊天室中為機構中的使用者安裝 Chat 應用程式。即時通訊應用程式通常會在聊天室中發布歡迎訊息,以回應這項互動事件。 管理員安裝 Chat 應用程式時,space.adminInstalled 欄位會設為 true ,使用者無法解除安裝。如要瞭解管理員安裝的 Chat 應用程式,請參閱 Google Workspace 管理員說明文件「在網域內安裝 Marketplace 中的應用程式」。 |
REMOVED_FROM_SPACE |
使用者從聊天室中移除 Chat 應用程式,或是 Google Workspace 管理員為機構中的使用者解除安裝 Chat 應用程式。即時通訊應用程式無法針對這項事件傳送訊息,因為訊息已遭移除。 當管理員解除安裝 Chat 應用程式時,space.adminInstalled 欄位會設為 false 。如果使用者在管理員安裝 Chat 應用程式之前就已安裝,Chat 應用程式仍會保留在使用者的裝置上,但不會收到 REMOVED_FROM_SPACE 互動事件。 |
CARD_CLICKED |
使用者點選 Chat 應用程式中資訊卡或對話方塊的互動式元素 (例如按鈕)。按鈕必須觸發與 Chat 應用程式的另一項互動,才能收到互動事件。舉例來說,如果使用者按下可開啟網站連結的按鈕,Chat 應用程式不會收到 CARD_CLICKED 互動事件,但會在下列情況下收到互動事件:
- 使用者按下資訊卡上的
Send feedback 按鈕,系統會開啟對話方塊,讓使用者輸入資訊。
- 使用者在資訊輸入資訊卡或對話方塊後,點選
Submit 按鈕。
如果使用者按下按鈕來開啟、提交或取消對話方塊,CARD_CLICKED 互動事件的 isDialogEvent 欄位就會設為 true ,並包含 DialogEventType 。 |
WIDGET_UPDATED |
使用者在資訊卡訊息或對話方塊中更新小工具。 |
APP_COMMAND |
使用者使用 Chat 應用程式的快速指令。 |
APP_HOME |
使用者透過使用應用程式首頁的 Chat 應用程式開啟即時訊息。這類事件只會納入 type 、user 和 space 欄位。詳情請參閱「建構 Google Chat 應用程式的首頁」。 |
SUBMIT_FORM |
使用者在應用程式主畫面資訊卡中提交資訊。這類事件只會納入 type 、user 和 space 欄位。詳情請參閱「建構 Google Chat 應用程式的首頁」。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-03-06 (世界標準時間)。
[null,null,["上次更新時間:2025-03-06 (世界標準時間)。"],[[["Google Chat app interaction events are triggered by various user actions, such as sending messages, adding/removing the app, interacting with cards, and updating widgets."],["These events provide context about the interaction, like the user, space, and specific action taken, allowing your app to respond appropriately."],["`ADDED_TO_SPACE` and `REMOVED_FROM_SPACE` events help manage the app's presence in spaces, while `CARD_CLICKED` enables handling user interactions with card elements."],["`MESSAGE` events cover various scenarios, including direct messages, @mentions, slash commands, and link previews, enabling diverse app functionalities."],["`APP_HOME` and `SUBMIT_FORM` events allow for interactions specific to apps that utilize the app home feature for a more integrated experience within Google Chat."]]],["Google Chat apps can receive various interaction events. These include `MESSAGE` (user messages or @mentions), `ADDED_TO_SPACE` (app added to space), `REMOVED_FROM_SPACE` (app removed), `CARD_CLICKED` (user clicks a card element), `WIDGET_UPDATED` (widget update), `APP_COMMAND` (user command), `APP_HOME` (user opens app home), and `SUBMIT_FORM` (user submits app home card). Each event triggers specific app actions, like posting welcome messages or responding to user input.\n"]]