TwitchLib 3.5.3
|
Moderation related APIs More...
Public Member Functions | |
Moderation (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) | |
Task | ManageHeldAutoModMessagesAsync (string userId, string msgId, ManageHeldAutoModMessageActionEnum action, string accessToken=null) |
Allow or deny a message that was held for review by AutoMod. More... | |
Task< CheckAutoModStatusResponse > | CheckAutoModStatusAsync (List< Message > messages, string broadcasterId, string accessToken=null) |
Determines whether a string message meets the channel’s AutoMod requirements. More... | |
Task< GetBannedEventsResponse > | GetBannedEventsAsync (string broadcasterId, List< string > userIds=null, string after=null, int first=20, string accessToken=null) |
Task< GetBannedUsersResponse > | GetBannedUsersAsync (string broadcasterId, List< string > userIds=null, int first=20, string after=null, string before=null, string accessToken=null) |
Returns all banned and timed-out users for a channel. More... | |
Task< GetModeratorsResponse > | GetModeratorsAsync (string broadcasterId, List< string > userIds=null, int first=20, string after=null, string accessToken=null) |
Returns all moderators in a channel. More... | |
Task< GetModeratorEventsResponse > | GetModeratorEventsAsync (string broadcasterId, List< string > userIds=null, string accessToken=null) |
Task< BanUserResponse > | BanUserAsync (string broadcasterId, string moderatorId, BanUserRequest banUserRequest, string accessToken=null) |
Ban or Timeout an user from chat. If a duration is specified it is treated as a timeout, if you omit a duration is a permanent ban. More... | |
Task | UnbanUserAsync (string broadcasterId, string moderatorId, string userId, string accessToken=null) |
Removes the ban or timeout that was placed on the specified user More... | |
Task< GetAutomodSettingsResponse > | GetAutomodSettingsAsync (string broadcasterId, string moderatorId, string accessToken=null) |
Gets the broadcaster’s AutoMod settings, which are used to automatically block inappropriate or harassing messages from appearing in the broadcaster’s chat room. More... | |
Task< UpdateAutomodSettingsResponse > | UpdateAutomodSettingsAsync (string broadcasterId, string moderatorId, AutomodSettings settings, string accessToken=null) |
Updates the broadcaster’s AutoMod settings, which are used to automatically block inappropriate or harassing messages from appearing in the broadcaster’s chat room. More... | |
Task< GetBlockedTermsResponse > | GetBlockedTermsAsync (string broadcasterId, string moderatorId, string after=null, int first=20, string accessToken=null) |
Gets the broadcaster’s list of non-private, blocked words or phrases. More... | |
Task< AddBlockedTermResponse > | AddBlockedTermAsync (string broadcasterId, string moderatorId, string term, string accessToken=null) |
Adds a word or phrase to the broadcaster’s list of blocked terms. More... | |
Task | DeleteBlockedTermAsync (string broadcasterId, string moderatorId, string termId, string accessToken=null) |
Removes the word or phrase that the broadcaster is blocking users from using in their chat room. More... | |
Task | DeleteChatMessagesAsync (string broadcasterId, string moderatorId, string messageId=null, string accessToken=null) |
Removes a single chat message or all chat messages from the broadcaster’s chat room. More... | |
Task | AddChannelModeratorAsync (string broadcasterId, string userId, string accessToken=null) |
Adds a moderator to the broadcaster’s chat room. Rate Limits: The channel may add a maximum of 10 moderators within a 10 seconds period. Requires a user access token that includes the channel:manage:moderators scope. More... | |
Task | DeleteChannelModeratorAsync (string broadcasterId, string userId, string accessToken=null) |
Removes a moderator from the broadcaster’s chat room. Rate Limits: The channel may remove a maximum of 10 moderators within a 10 seconds period. Requires a user access token that includes the channel:manage:moderators scope. More... | |
Public Member Functions inherited from TwitchLib.Api.Core.ApiBase | |
ApiBase (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http) | |
async ValueTask< string > | GetAccessTokenAsync (string accessToken=null) |
Additional Inherited Members | |
Protected Member Functions inherited from TwitchLib.Api.Core.ApiBase | |
async Task< string > | TwitchGetAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< T > | TwitchGetGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< T > | TwitchPatchGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< string > | TwitchPatchAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< KeyValuePair< int, string > > | TwitchDeleteAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< T > | TwitchPostGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< T > | TwitchPostGenericModelAsync< T > (string resource, ApiVersion api, RequestModel model, string accessToken=null, string clientId=null, string customBase=null) |
async Task< T > | TwitchDeleteGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< T > | TwitchPutGenericAsync< T > (string resource, ApiVersion api, string payload=null, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< string > | TwitchPutAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
async Task< KeyValuePair< int, string > > | TwitchPostAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null) |
Task | PutBytesAsync (string url, byte[] payload) |
async Task< T > | GetGenericAsync< T > (string url, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, ApiVersion api=ApiVersion.Helix, string clientId=null) |
Protected Attributes inherited from TwitchLib.Api.Core.ApiBase | |
readonly IApiSettings | Settings |
Moderation related APIs
TwitchLib.Api.Helix.Moderation.Moderation | ( | IApiSettings | settings, |
IRateLimiter | rateLimiter, | ||
IHttpCallHandler | http | ||
) |
Task< AddBlockedTermResponse > TwitchLib.Api.Helix.Moderation.AddBlockedTermAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
string | term, | ||
string | accessToken = null |
||
) |
Adds a word or phrase to the broadcaster’s list of blocked terms.
Requires a User access token with scope set to moderator:manage:blocked_terms.
broadcasterId | The ID of the broadcaster that owns the list of blocked terms. |
moderatorId | The ID of a user that has permission to moderate the broadcaster’s chat room. |
This ID must match the user ID associated with the user OAuth token.
If the broadcaster wants to add the blocked term (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.
term | The word or phrase to block from being used in the broadcaster’s chat room. |
The term must contain a minimum of 2 characters and may contain up to a maximum of 500 characters.
Terms can use a wildcard character (*).
The wildcard character must appear at the beginning or end of a word, or set of characters. For example, foo or foo.
accessToken | optional access token to override the one used while creating the TwitchAPI object |
BadParameterException |
Task TwitchLib.Api.Helix.Moderation.AddChannelModeratorAsync | ( | string | broadcasterId, |
string | userId, | ||
string | accessToken = null |
||
) |
Adds a moderator to the broadcaster’s chat room. Rate Limits: The channel may add a maximum of 10 moderators within a 10 seconds period. Requires a user access token that includes the channel:manage:moderators scope.
broadcasterId | The ID of the broadcaster that owns the chat room. |
userId | The ID of the user to add as a moderator in the broadcaster’s chat room. |
accessToken | optional access token to override the one used while creating the TwitchAPI object |
Task< BanUserResponse > TwitchLib.Api.Helix.Moderation.BanUserAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
BanUserRequest | banUserRequest, | ||
string | accessToken = null |
||
) |
Ban or Timeout an user from chat. If a duration is specified it is treated as a timeout, if you omit a duration is a permanent ban.
Requires a User access token with scope set to moderator:manage:banned_users.
broadcasterId | Id of the broadcaster channel from which you want to ban/timeout somebody |
moderatorId | Id of the moderator that wants to ban/timeout somebody (if you use the broadcaster account this has to be the broadcasterId) |
banUserRequest | request object containing the information about the ban like the userId of the user to ban, the reason and optional duration |
accessToken | optional access token to override the one used while creating the TwitchAPI object |
BadParameterException |
Task< CheckAutoModStatusResponse > TwitchLib.Api.Helix.Moderation.CheckAutoModStatusAsync | ( | List< Message > | messages, |
string | broadcasterId, | ||
string | accessToken = null |
||
) |
Determines whether a string message meets the channel’s AutoMod requirements.
Rate Limits: Rates are limited per channel based on the account type rather than per access token.
Normal: 5 per Minute / 50 per hour
Affiliate: 10 per Minute / 100 per hour
Partner: 30 per Minute / 300 per hour
Required Scope: moderation:read
messages | List of messages to check |
broadcasterId | BroadcasterId to test against. Provided broadcasterId must match the userId in the auth token. |
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
BadParameterException |
Task TwitchLib.Api.Helix.Moderation.DeleteBlockedTermAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
string | termId, | ||
string | accessToken = null |
||
) |
Removes the word or phrase that the broadcaster is blocking users from using in their chat room.
Requires a User access token with scope set to moderator:manage:blocked_terms.
broadcasterId | The ID of the broadcaster that owns the list of blocked terms. |
moderatorId | The ID of the broadcaster or a user that has permission to moderate the broadcaster’s chat room. |
This ID must match the user ID associated with the user OAuth token.
termId | The ID of the blocked term you want to delete. |
accessToken | optional access token to override the one used while creating the TwitchAPI object |
BadParameterException |
Task TwitchLib.Api.Helix.Moderation.DeleteChannelModeratorAsync | ( | string | broadcasterId, |
string | userId, | ||
string | accessToken = null |
||
) |
Removes a moderator from the broadcaster’s chat room. Rate Limits: The channel may remove a maximum of 10 moderators within a 10 seconds period. Requires a user access token that includes the channel:manage:moderators scope.
broadcasterId | The ID of the broadcaster that owns the chat room. |
userId | The ID of the user to remove as a moderator from the broadcaster’s chat room. |
accessToken | optional access token to override the one used while creating the TwitchAPI object |
Task TwitchLib.Api.Helix.Moderation.DeleteChatMessagesAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
string | messageId = null , |
||
string | accessToken = null |
||
) |
Removes a single chat message or all chat messages from the broadcaster’s chat room.
!!! If no messageId is specified, the request removes all messages in the broadcaster’s chat room. !!!
The message must have been created within the last 6 hours.
The message must not belong to the broadcaster.
The message must not belong to another moderator.
Requires a user access token that includes the moderator:manage:chat_messages scope.
broadcasterId | The ID of the broadcaster that owns the chat room to remove messages from. |
moderatorId | The ID of a user that has permission to moderate the broadcaster’s chat room. This ID must match the user ID in the OAuth token. |
messageId | The ID of the message to remove. |
!!! If not specified, the request removes all messages in the broadcaster’s chat room. !!!
accessToken | optional access token to override the one used while creating the TwitchAPI object |
Task< GetAutomodSettingsResponse > TwitchLib.Api.Helix.Moderation.GetAutomodSettingsAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
string | accessToken = null |
||
) |
Gets the broadcaster’s AutoMod settings, which are used to automatically block inappropriate or harassing messages from appearing in the broadcaster’s chat room.
Requires a User access token with scope set to moderator:read:automod_settings.
broadcasterId | The ID of the broadcaster whose AutoMod settings you want to get. |
moderatorId | The ID of a user that has permission to moderate the broadcaster’s chat room. |
This ID must match the user ID associated with the user OAuth token.
If the broadcaster wants to get their own AutoMod settings (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.
accessToken | optional access token to override the one used while creating the TwitchAPI object |
BadParameterException |
Task< GetBannedEventsResponse > TwitchLib.Api.Helix.Moderation.GetBannedEventsAsync | ( | string | broadcasterId, |
List< string > | userIds = null , |
||
string | after = null , |
||
int | first = 20 , |
||
string | accessToken = null |
||
) |
Task< GetBannedUsersResponse > TwitchLib.Api.Helix.Moderation.GetBannedUsersAsync | ( | string | broadcasterId, |
List< string > | userIds = null , |
||
int | first = 20 , |
||
string | after = null , |
||
string | before = null , |
||
string | accessToken = null |
||
) |
Returns all banned and timed-out users for a channel.
Required scope: moderation:read
broadcasterId | BroadcasterId to get banned users for. Provided broadcaster_id must match the user_id in the OAuth token. |
userIds | Filters the results and only returns a status object for users who are banned in the channel and have a matching user_id. |
first | Maximum number of objects to return. 1 - 100. Default 1 |
after | Cursor for forward pagination. |
before | Cursor for backward pagination. |
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
Task< GetBlockedTermsResponse > TwitchLib.Api.Helix.Moderation.GetBlockedTermsAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
string | after = null , |
||
int | first = 20 , |
||
string | accessToken = null |
||
) |
Gets the broadcaster’s list of non-private, blocked words or phrases.
These are the terms that the broadcaster or moderator added manually, or that were denied by AutoMod.
Requires a User access token with scope set to moderator:read:blocked_terms.
broadcasterId | The ID of the broadcaster whose blocked terms you’re getting. |
moderatorId | The ID of a user that has permission to moderate the broadcaster’s chat room. |
This ID must match the user ID associated with the user OAuth token.
If the broadcaster wants to get their own block terms (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.
after | The cursor used to get the next page of results. |
first | The maximum number of blocked terms to return per page in the response. |
The minimum page size is 1 blocked term per page and the maximum is 100. The default is 20.
accessToken | optional access token to override the one used while creating the TwitchAPI object |
BadParameterException |
Task< GetModeratorEventsResponse > TwitchLib.Api.Helix.Moderation.GetModeratorEventsAsync | ( | string | broadcasterId, |
List< string > | userIds = null , |
||
string | accessToken = null |
||
) |
Task< GetModeratorsResponse > TwitchLib.Api.Helix.Moderation.GetModeratorsAsync | ( | string | broadcasterId, |
List< string > | userIds = null , |
||
int | first = 20 , |
||
string | after = null , |
||
string | accessToken = null |
||
) |
Returns all moderators in a channel.
Note: This endpoint does not return the broadcaster in the response, as broadcasters are channel owners and have all permissions of moderators implicitly.
Requires a user access token that includes the moderation:read scope.
The ID in the broadcaster_id query parameter must match the user ID in the access token.
broadcasterId | Broadcaster to get the moderators for |
userIds | Filters the results and only returns a status object for users who are moderators in this channel and have a matching user_id. |
Maximum: 100
first | Maximum number of objects to return. Maximum: 100. Default: 20. |
after | Cursor for forward pagination: tells the server where to start fetching the next set of results in a multi-page response. |
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
BadParameterException |
Task TwitchLib.Api.Helix.Moderation.ManageHeldAutoModMessagesAsync | ( | string | userId, |
string | msgId, | ||
ManageHeldAutoModMessageActionEnum | action, | ||
string | accessToken = null |
||
) |
Allow or deny a message that was held for review by AutoMod.
Required Scope: moderator:manage:automod
userId | The moderator who is approving or rejecting the held message. Must match the user_id in the user OAuth token. |
msgId | ID of the message to be allowed or denied. |
action | The action to take for the message. |
Must be "ALLOW" or "DENY".
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
BadParameterException |
Task TwitchLib.Api.Helix.Moderation.UnbanUserAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
string | userId, | ||
string | accessToken = null |
||
) |
Removes the ban or timeout that was placed on the specified user
Requires a User access token with scope set to moderator:manage:banned_users.
broadcasterId | The ID of the broadcaster whose chat room the user is banned from chatting in. |
moderatorId | The ID of a user that has permission to moderate the broadcaster’s chat room. |
This ID must match the user ID associated with the user OAuth token.
userId | The ID of the user to remove the ban or timeout from. |
accessToken | optional access token to override the use of the stored one in the TwitchAPI instance |
BadParameterException |
Task< UpdateAutomodSettingsResponse > TwitchLib.Api.Helix.Moderation.UpdateAutomodSettingsAsync | ( | string | broadcasterId, |
string | moderatorId, | ||
AutomodSettings | settings, | ||
string | accessToken = null |
||
) |
Updates the broadcaster’s AutoMod settings, which are used to automatically block inappropriate or harassing messages from appearing in the broadcaster’s chat room.
Requires a User access token with scope set to moderator:manage:automod_settings.
broadcasterId | The ID of the broadcaster whose AutoMod settings you want to update. |
moderatorId | The ID of a user that has permission to moderate the broadcaster’s chat room. |
This ID must match the user ID associated with the user OAuth token.
If the broadcaster wants to update their own AutoMod settings (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.
settings | |
accessToken | optional access token to override the one used while creating the TwitchAPI object |
BadParameterException |