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
- 此对象,用于链式调用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-30。
[null,null,["最后更新时间 (UTC):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"]]