LiveChatBans
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tài nguyên liveChatBan
xác định một người dùng YouTube và một cuộc trò chuyện trực tiếp trên YouTube mà người dùng đó bị cấm tham gia.
Phương thức
API này hỗ trợ các phương thức sau cho tài nguyên liveChatBans
:
- chèn
- Ngăn một người dùng cụ thể tham gia cuộc trò chuyện trực tiếp. Yêu cầu API phải được chủ sở hữu kênh hoặc người kiểm duyệt cuộc trò chuyện trực tiếp liên quan đến lệnh cấm uỷ quyền.
Thử ngay.
- xóa
- Xoá lệnh cấm ngăn một người dùng cụ thể đóng góp vào cuộc trò chuyện trực tiếp, nhờ đó cho phép người dùng đó tham gia lại cuộc trò chuyện. Yêu cầu API phải được chủ sở hữu kênh hoặc người kiểm duyệt cuộc trò chuyện trực tiếp liên quan đến lệnh cấm uỷ quyền.
Thử ngay.
Thuộc tính
Bảng sau đây xác định các thuộc tính xuất hiện trong tài nguyên này:
Thuộc tính |
kind |
string Xác định loại tài nguyên API. Giá trị sẽ là youtube#liveChatBan . |
etag |
etag
Etag của tài nguyên này. |
id |
string
Mã nhận dạng do YouTube chỉ định để xác định riêng biệt lệnh cấm. |
snippet |
object
Đối tượng snippet xác định người dùng bị cấm và chứa thông tin chi tiết về lệnh cấm. |
snippet.liveChatId |
string
Cuộc trò chuyện trực tiếp bị áp dụng lệnh cấm. Mã cuộc trò chuyện trực tiếp liên kết với một thông báo truyền tin sẽ được trả về trong thuộc tính snippet.liveChatId của tài nguyên liveBroadcast . |
snippet.type |
string
Loại lệnh cấm.
Các giá trị hợp lệ cho thuộc tính này là:
|
snippet.banDurationSeconds |
unsigned long
Thời gian bị cấm. Chỉ đặt giá trị cho thuộc tính này nếu loại lệnh cấm là temporary . Giá trị mặc định là 300 (5 phút). |
snippet.bannedUserDetails |
object
Đối tượng này chứa thông tin nhận dạng người dùng bị cấm. |
snippet.bannedUserDetails.channelId |
string
Mã nhận dạng kênh YouTube của người dùng bị cấm. |
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-06-06 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-06-06 UTC."],[[["\u003cp\u003eA \u003ccode\u003eliveChatBan\u003c/code\u003e resource identifies a YouTube user who is banned from a specific YouTube live chat.\u003c/p\u003e\n"],["\u003cp\u003eThe API allows channel owners or moderators to insert a \u003ccode\u003eliveChatBan\u003c/code\u003e to ban a user or delete one to remove the ban.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eliveChatBan\u003c/code\u003e can be either permanent or temporary, and the duration of a temporary ban can be specified in seconds.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eliveChatBan\u003c/code\u003e resource's \u003ccode\u003esnippet\u003c/code\u003e object includes the ID of the live chat, the type of ban, the ban duration (if temporary), and details of the banned user.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eliveChatBan\u003c/code\u003e resource has properties such as \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eetag\u003c/code\u003e, and \u003ccode\u003eid\u003c/code\u003e, which provide general information about the resource, such as the resource type, its ETag, and the ban's unique ID.\u003c/p\u003e\n"]]],["The `liveChatBan` resource manages user bans in YouTube live chats. Key actions include: inserting a ban (`insert`) to prevent a user from participating, and deleting a ban (`delete`) to allow a user to rejoin. The resource identifies the banned user, the live chat, ban type (`permanent` or `temporary`), and ban duration in seconds. The resource properties include `kind`, `etag`, and `id`. Authorization from the channel owner or a moderator is required for both inserting and deleting.\n"],null,["# LiveChatBans\n\nA **liveChatBan** resource identifies a YouTube user and a YouTube live chat that the user is banned from participating in.\n\nMethods\n-------\n\nThe API supports the following methods for `liveChatBans` resources:\n\n[insert](/youtube/v3/live/docs/liveChatBans/insert)\n: Bans a specific user from participating in the live chat. The API request must be authorized by the channel owner or a moderator of the live chat associated with the ban.\n [Try it now](/youtube/v3/live/docs/liveChatBans/insert#try-it).\n\n[delete](/youtube/v3/live/docs/liveChatBans/delete)\n: Removes a ban that prevents a specific user from contributing to a live chat, thereby enabling the user to rejoin the chat. The API request must be authorized by the channel owner or a moderator of the live chat associated with the ban.\n [Try it now](/youtube/v3/live/docs/liveChatBans/delete#try-it).\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `liveChatBans` resource: \n\n```carbon\n{\n \"#kind\": \"youtube#liveChatBan\",\n \"#etag\": etag,\n \"#id\": string,\n \"#snippet\": {\n \"#snippet.liveChatId\": string,\n \"#snippet.type\": string,\n \"#snippet.banDurationSeconds\": unsigned long,\n \"#snippet.bannedUserDetails\": {\n \"#snippet.bannedUserDetails.channelId\": string\n }\n }\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#liveChatBan`. |\n| `etag` | `etag` The Etag of this resource. |\n| `id` | `string` The ID that YouTube assigns to uniquely identify the ban. |\n| `snippet` | `object` The `snippet` object identifies the banned user and contains details about the ban. |\n| snippet.`liveChatId` | `string` The live chat to which the ban applies. The live chat ID associated with a broadcast is returned in the `liveBroadcast` resource's `snippet.liveChatId` property. |\n| snippet.`type` | `string` The type of ban. Valid values for this property are: - `permanent` - `temporary` |\n| snippet.`banDurationSeconds` | `unsigned long` The duration of the ban. Only set a value for this property if the ban's type is `temporary`. The default value is `300` (5 minutes). |\n| snippet.`bannedUserDetails` | `object` This object contains information that identifies the banned user. |\n| snippet.bannedUserDetails.`channelId` | `string` The banned user's YouTube channel ID. |"]]