Class ChatSpaceDataSource
聊天空間資料來源資料來源,可將 Google Chat 聊天室填入多重選取選單的選項。只會填入使用者是成員的聊天室。
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
僅適用於 Google Chat 應用程式。不適用於 Google Workspace 外掛程式。
內容詳盡的說明文件
setDefaultToCurrentSpace(defaultToCurrentSpace)
如果設為 true
,多重選取選單會預設選取目前的 Google Chat 聊天室做為項目。
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
僅適用於 Google Chat 應用程式。不適用於 Google Workspace 外掛程式。
參數
名稱 | 類型 | 說明 |
defaultToCurrentSpace | Boolean | 要設定的布林值。 |
回攻員
ChatSpaceDataSource
:這個物件用於鏈結。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-01-30 (世界標準時間)。
[null,null,["上次更新時間:2025-01-30 (世界標準時間)。"],[[["ChatSpaceDataSource populates Google Chat spaces as selection items in a multiselect menu, limited to spaces the user has joined."],["It's exclusively for Google Chat apps and unavailable for Google Workspace Add-ons."],["This data source can be configured to default to the current Chat space as a selected item in the menu."]]],["`ChatSpaceDataSource` populates a multiselect menu with Google Chat spaces the user belongs to. `setDefaultToCurrentSpace(true)` sets the current Chat space as the default selection in the menu. This functionality is exclusively for Google Chat apps, not Google Workspace add-ons. The `setDefaultToCurrentSpace` method takes a boolean as input and returns the `ChatSpaceDataSource` object. `newChatSpaceDataSource()` is used to create the object.\n"]]