LiveChatBans
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
liveChatBan
资源用于标识 YouTube 用户以及该用户被禁止参与的 YouTube 实时聊天。
方法
该 API 支持对 liveChatBans
资源使用以下方法:
- insert
- 禁止特定用户参与实时聊天。此 API 请求必须由频道所有者或与禁播相关联的直播聊天室的管理员授权。
立即试用。
- delete
- 解除禁止特定用户参与实时聊天的禁令,以便该用户重新加入聊天。此 API 请求必须由频道所有者或与禁播相关联的直播聊天室的管理员授权。
立即试用。
属性
下表定义了此资源中显示的属性:
属性 |
kind |
string
用于标识 API 资源的类型。该值将为 youtube#liveChatBan 。 |
etag |
etag
此资源的 ETag。 |
id |
string
由 YouTube 分配的 ID,用于唯一标识禁播。 |
snippet |
object
snippet 对象用于标识被禁用户,并包含有关禁用的详细信息。 |
snippet.liveChatId |
string
禁播所涵盖的实时聊天。与直播关联的实时聊天 ID 会在 liveBroadcast 资源的 snippet.liveChatId 属性中返回。 |
snippet.type |
string
禁播类型。
此属性的有效值如下:
|
snippet.banDurationSeconds |
unsigned long
禁播时长。仅当禁播类型为 temporary 时,才为此属性设置值。默认值为 300 (5 分钟)。 |
snippet.bannedUserDetails |
object
此对象包含用于标识被禁用户的信息。 |
snippet.bannedUserDetails.channelId |
string
被禁用户的 YouTube 频道 ID。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-06-06。
[null,null,["最后更新时间 (UTC):2025-06-06。"],[[["\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. |"]]