TwitchLib 3.5.3
Loading...
Searching...
No Matches
TwitchLib.Api.Helix.Moderation Class Reference

Moderation related APIs More...

Inheritance diagram for TwitchLib.Api.Helix.Moderation:
TwitchLib.Api.Core.ApiBase

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< CheckAutoModStatusResponseCheckAutoModStatusAsync (List< Message > messages, string broadcasterId, string accessToken=null)
 Determines whether a string message meets the channel’s AutoMod requirements. More...
 
Task< GetBannedEventsResponseGetBannedEventsAsync (string broadcasterId, List< string > userIds=null, string after=null, int first=20, string accessToken=null)
 
Task< GetBannedUsersResponseGetBannedUsersAsync (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< GetModeratorsResponseGetModeratorsAsync (string broadcasterId, List< string > userIds=null, int first=20, string after=null, string accessToken=null)
 Returns all moderators in a channel. More...
 
Task< GetModeratorEventsResponseGetModeratorEventsAsync (string broadcasterId, List< string > userIds=null, string accessToken=null)
 
Task< BanUserResponseBanUserAsync (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< GetAutomodSettingsResponseGetAutomodSettingsAsync (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< UpdateAutomodSettingsResponseUpdateAutomodSettingsAsync (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< GetBlockedTermsResponseGetBlockedTermsAsync (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< AddBlockedTermResponseAddBlockedTermAsync (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
 

Detailed Description

Moderation related APIs

Constructor & Destructor Documentation

◆ Moderation()

TwitchLib.Api.Helix.Moderation.Moderation ( IApiSettings  settings,
IRateLimiter  rateLimiter,
IHttpCallHandler  http 
)

Member Function Documentation

◆ AddBlockedTermAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster that owns the list of blocked terms.
moderatorIdThe 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.

Parameters
termThe 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.

Parameters
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns
Exceptions
BadParameterException

◆ AddChannelModeratorAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster that owns the chat room.
userIdThe ID of the user to add as a moderator in the broadcaster’s chat room.
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns

◆ BanUserAsync()

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.

Parameters
broadcasterIdId of the broadcaster channel from which you want to ban/timeout somebody
moderatorIdId of the moderator that wants to ban/timeout somebody (if you use the broadcaster account this has to be the broadcasterId)
banUserRequestrequest object containing the information about the ban like the userId of the user to ban, the reason and optional duration
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns
Exceptions
BadParameterException

◆ CheckAutoModStatusAsync()

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

Parameters
messagesList of messages to check
broadcasterIdBroadcasterId to test against. Provided broadcasterId must match the userId in the auth token.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ DeleteBlockedTermAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster that owns the list of blocked terms.
moderatorIdThe 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.

Parameters
termIdThe ID of the blocked term you want to delete.
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns
Exceptions
BadParameterException

◆ DeleteChannelModeratorAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster that owns the chat room.
userIdThe ID of the user to remove as a moderator from the broadcaster’s chat room.
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns

◆ DeleteChatMessagesAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster that owns the chat room to remove messages from.
moderatorIdThe 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.
messageIdThe ID of the message to remove.

!!! If not specified, the request removes all messages in the broadcaster’s chat room. !!!

Parameters
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns

◆ GetAutomodSettingsAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster whose AutoMod settings you want to get.
moderatorIdThe 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.

Parameters
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns
Exceptions
BadParameterException

◆ GetBannedEventsAsync()

Task< GetBannedEventsResponse > TwitchLib.Api.Helix.Moderation.GetBannedEventsAsync ( string  broadcasterId,
List< string >  userIds = null,
string  after = null,
int  first = 20,
string  accessToken = null 
)

◆ GetBannedUsersAsync()

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

Parameters
broadcasterIdBroadcasterId to get banned users for. Provided broadcaster_id must match the user_id in the OAuth token.
userIdsFilters the results and only returns a status object for users who are banned in the channel and have a matching user_id.
firstMaximum number of objects to return. 1 - 100. Default 1
afterCursor for forward pagination.
beforeCursor for backward pagination.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetBlockedTermsAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster whose blocked terms you’re getting.
moderatorIdThe 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.

Parameters
afterThe cursor used to get the next page of results.
firstThe 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.

Parameters
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns
Exceptions
BadParameterException

◆ GetModeratorEventsAsync()

Task< GetModeratorEventsResponse > TwitchLib.Api.Helix.Moderation.GetModeratorEventsAsync ( string  broadcasterId,
List< string >  userIds = null,
string  accessToken = null 
)

◆ GetModeratorsAsync()

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.

Parameters
broadcasterIdBroadcaster to get the moderators for
userIdsFilters the results and only returns a status object for users who are moderators in this channel and have a matching user_id.

Maximum: 100

Parameters
firstMaximum number of objects to return. Maximum: 100. Default: 20.
afterCursor for forward pagination: tells the server where to start fetching the next set of results in a multi-page response.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ ManageHeldAutoModMessagesAsync()

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

Parameters
userIdThe moderator who is approving or rejecting the held message. Must match the user_id in the user OAuth token.
msgIdID of the message to be allowed or denied.
actionThe action to take for the message.

Must be "ALLOW" or "DENY".

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ UnbanUserAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster whose chat room the user is banned from chatting in.
moderatorIdThe 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.

Parameters
userIdThe ID of the user to remove the ban or timeout from.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ UpdateAutomodSettingsAsync()

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.

Parameters
broadcasterIdThe ID of the broadcaster whose AutoMod settings you want to update.
moderatorIdThe 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.

Parameters
settings
accessTokenoptional access token to override the one used while creating the TwitchAPI object
Returns
Exceptions
BadParameterException

The documentation for this class was generated from the following file: