Class ChatSpaceDataSource
Cuộc trò chuyệnKhông gianNguồndữ liệu
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);
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
setDefaultToCurrentSpace(defaultToCurrentSpace)
Nếu được đặt thành true
, trình đơn chọn nhiều mục sẽ chọn không gian Google Chat hiện tại làm một mục theo mặc định.
const chatSpaceDataSource =
CardService.newChatSpaceDataSource().setDefaultToCurrentSpace(true);
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ố
Tên | Loại | Mô tả |
defaultToCurrentSpace | Boolean | Giá trị boolean cần đặt. |
Cầu thủ trả bóng
ChatSpaceDataSource
– Đố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."],[[["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"]]