Class ChatClientDataSource
ChatClientDataSource
Đối với tiện ích SelectionInput
sử dụng trình đơn nhiều lựa chọn, một nguồn dữ liệu từ Google Chat.
Nguồn dữ liệu sẽ điền các mục lựa chọn cho trình đơn đa lựa chọn. Ví dụ: người dùng có thể chọn các không gian Google Chat mà họ là thành viên.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
Chỉ dành cho ứng dụng Google Chat. Không dùng được cho các tiện ích bổ sung của Google Workspace.
Tài liệu chi tiết
setSpaceDataSource(spaceDataSource)
Nguồn dữ liệu điền sẵn các không gian trên Google Chat làm mục lựa chọn cho trình đơn nhiều lựa chọn. Chỉ điền sẵn những không gian mà người dùng là thành viên.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
const chatClientDataSource =
CardService.newChatClientDataSource().setSpaceDataSource(
chatSpaceDataSource);
Chỉ dành cho ứng dụng Google Chat. Không dùng được cho các tiện ích bổ sung của Google Workspace.
Thông số
Cầu thủ trả bóng
ChatClientDataSource
– Đối tượng này, để tạo chuỗi.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-01-30 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-01-30 UTC."],[[["`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"]]