Class ChatClientDataSource
ChatClientDataSource
对于使用多选菜单的 SelectionInput
微件,Google Chat 中的数据源。
数据源会为多选菜单填充选择项。例如,用户可以选择自己是成员的 Google Chat 聊天室。
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
仅适用于 Google Chat 应用。不适用于 Google Workspace 插件。
详细文档
setSpaceDataSource(spaceDataSource)
一种数据源,用于将 Google Chat 聊天室填充为多选菜单的选择项。仅填充用户是成员的聊天室。
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
仅适用于 Google Chat 应用。不适用于 Google Workspace 插件。
参数
返回
ChatClientDataSource
- 此对象,用于链式调用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-30。
[null,null,["最后更新时间 (UTC):2025-01-30。"],[[["`ChatClientDataSource` is used for multiselect menus in Google Chat apps, allowing users to select items like Google Chat spaces they are members of."],["This data source relies on a `ChatSpaceDataSource` to populate the selectable spaces in the menu."],["It is exclusively available for Google Chat apps and cannot be utilized in Google Workspace Add-ons."],["The `setSpaceDataSource` method configures the data source for populating Google Chat spaces in the selection menu, limited to spaces where the user is a member."]]],["`ChatClientDataSource` is a data source for multiselect menus in Google Chat apps. It populates selection items with Google Chat spaces a user belongs to. The `setSpaceDataSource` method configures this behavior, taking a `ChatSpaceDataSource` as input. Using `CardService.newChatClientDataSource()` allows the setting up the data source and `CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true)` allows the default current space. The data is only available for Google Chat apps, not Google Workspace add-ons.\n"]]