Overview
Methods
- addBlockedTerma
- addModeratora
- banUsera
- checkAutoModStatusa
- checkUserBana
- checkUserModa
- deleteChatMessagesa
- getAutoModSettingsa
- getBannedUsersa
- getBannedUsersPaginated
- getBlockedTermsa
- getModeratedChannelsa
- getModeratedChannelsPaginated
- getModeratorsa
- getModeratorsPaginated
- getShieldModeStatusa
- getUnbanRequestsa
- getUnbanRequestsPaginated
- processHeldAutoModMessagea
- removeBlockedTerma
- removeModeratora
- resolveUnbanRequesta
- unbanUsera
- updateAutoModSettingsa
- updateShieldModeStatusa
- warnUsera
Can be accessed using client.moderation
on an ApiClient instance.
Example
const api = new ApiClient({ authProvider });
const { data: users } = await api.moderation.getBannedUsers('61369223');
Methods
addBlockedTerm(broadcaster, text)
asyncAdds a blocked term to the broadcaster's channel.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster in whose channel the term will be blocked. | |
text | string | none | The word or phrase to block from being used in the broadcaster's channel. |
addModerator(broadcaster, user)
asyncAdds a moderator to the broadcaster’s chat room.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster that owns the chat room. This ID must match the user ID in the access token. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to add as a moderator in the broadcaster’s chat room. |
banUser(broadcaster, data)
asyncBans or times out a user in a channel.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster in whose channel the user will be banned/timed out. | |
data | HelixBanUserRequest | none | see below | |
data.duration | number | none | The duration (in seconds) that the user should be timed out. If this value is null, the user will be banned. | |
data.reason | string | none | The reason why the user is being timed out/banned. | |
data.user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user who is to be banned/timed out. |
checkAutoModStatus(channel, data)
asyncDetermines whether a string message meets the channel's AutoMod requirements.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel in which the messages to check are posted. | |
data | HelixCheckAutoModStatusData[] | none | An array of message data objects. |
checkUserBan(channel, user)
asyncChecks whether a given user is banned in a given channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel to check for a ban of the given user. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to check for a ban in the given channel. |
checkUserMod(channel, user)
asyncChecks whether a given user is a moderator of a given channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel to check. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to check. |
deleteChatMessages(broadcaster, messageId)
asyncRemoves a single chat message or all chat messages from the broadcaster’s chat room.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster the chat belongs to. | |
messageId | string | none | The ID of the message to remove. If not specified, the request removes all messages in the broadcaster’s chat room. |
getAutoModSettings(broadcaster)
asyncGets the AutoMod settings for a broadcaster.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster to get the AutoMod settings for. |
getBannedUsers(channel, filter)
asyncGets a list of banned users in a given channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel to get the banned users from. | |
filter | HelixBanFilter | none | Additional filters for the result set. | |
filter.after | string | none | A cursor to get the following page of. | |
filter.limit | number | none | The number of results per page. | |
filter.userId | string | string[] | none | A user ID or a list thereof. |
getBannedUsersPaginated(channel)
Creates a paginator for banned users in a given channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel to get the banned users from. |
getBlockedTerms(broadcaster, pagination)
asyncGets the broadcaster’s list of non-private, blocked words or phrases.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster to get their channel's blocked terms for. | |
pagination | HelixForwardPagination | none | see below | |
pagination.after | string | none | A cursor to get the following page of. | |
pagination.limit | number | none | The number of results per page. |
getModeratedChannels(user, filter)
asyncGets a list of channels where the specified user has moderator privileges.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user for whom to return a list of channels where they have moderator privileges. This ID must match the user ID in the access token. | |
filter | HelixForwardPagination | none | see below | |
filter.after | string | none | A cursor to get the following page of. | |
filter.limit | number | none | The number of results per page. |
getModeratedChannelsPaginated(user)
Creates a paginator for channels where the specified user has moderator privileges.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user for whom to return the list of channels where they have moderator privileges. This ID must match the user ID in the access token. |
getModerators(channel, filter)
asyncGets a list of moderators in a given channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel to get moderators from. | |
filter | HelixModeratorFilter | none | Additional filters for the result set. | |
filter.after | string | none | A cursor to get the following page of. | |
filter.limit | number | none | The number of results per page. | |
filter.userId | string | string[] | none | A user ID or a list thereof. |
getModeratorsPaginated(channel)
Creates a paginator for moderators in a given channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
channel | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The channel to get moderators from. |
getShieldModeStatus(broadcaster)
asyncGets the broadcaster's Shield Mode activation status.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster whose Shield Mode activation status you want to get. |
getUnbanRequests(broadcaster, status, filter)
asyncGets a list of unban requests.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster to get unban requests of. | |
status | HelixUnbanRequestStatus Status of an unban request. Aliased type: "pending" | "approved" | "denied" | "acknowledged" | "canceled" | none | The status of unban requests to retrieve. | |
filter | HelixUnbanRequestFilter | none | Additional filters for the result set. |
getUnbanRequestsPaginated(broadcaster, status)
Creates a paginator for unban requests.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster to get unban requests of. | |
status | HelixUnbanRequestStatus Status of an unban request. Aliased type: "pending" | "approved" | "denied" | "acknowledged" | "canceled" | none | The status of unban requests to retrieve. |
processHeldAutoModMessage(user, msgId, allow)
asyncProcesses a message held by AutoMod.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user who is processing the message. | |
msgId | string | none | The ID of the message. | |
allow | boolean | none | Whether to allow the message - |
removeBlockedTerm(broadcaster, moderator, id)
asyncRemoves a blocked term from the broadcaster's channel.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster in whose channel the term will be unblocked. | |
moderator | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | A user that has permission to unblock terms in the broadcaster's channel. The token of this user will be used to remove the blocked term. | |
id | string | none | The ID of the term that should be unblocked. |
removeModerator(broadcaster, user)
asyncRemoves a moderator from the broadcaster’s chat room.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster that owns the chat room. This ID must match the user ID in the access token. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user to remove as a moderator from the broadcaster’s chat room. |
resolveUnbanRequest(broadcaster, unbanRequestId, approved, resolutionMessage)
asyncResolves an unban request by approving or denying it.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The ID of the broadcaster whose channel is approving or denying the unban request. | |
unbanRequestId | string | none | The ID of the unban request to resolve. | |
approved | boolean | none | Whether to approve or deny the unban request. | |
resolutionMessage | string | none | Message supplied by the unban request resolver. The message is limited to a maximum of 500 characters. |
unbanUser(broadcaster, user)
asyncUnbans/removes the timeout for a user in a channel.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster in whose channel the user will be unbanned/removed from timeout. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The user who will be unbanned/removed from timeout. |
updateAutoModSettings(broadcaster, data)
asyncUpdates the AutoMod settings for a broadcaster.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster for which the AutoMod settings are updated. | |
data | HelixAutoModSettingsUpdate | none | The updated AutoMod settings that replace the current AutoMod settings. |
updateShieldModeStatus(broadcaster, activate)
asyncActivates or deactivates the broadcaster's Shield Mode.
This uses the token of the broadcaster by default. If you want to execute this in the context of another user (who has to be moderator of the channel) you can do so using user context overrides.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The broadcaster whose Shield Mode you want to activate or deactivate. | |
activate | boolean | none | The desired Shield Mode status on the broadcaster's channel. |
warnUser(broadcaster, user, reason)
asyncWarns a user in the specified broadcaster’s chat room, preventing them from chat interaction until the warning is acknowledged.
New warnings can be issued to a user when they already have a warning in the channel (new warning will replace old warning).
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
broadcaster | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The ID of the broadcaster in which channel the warning will take effect. | |
user | UserIdResolvable A user ID or a user or channel object. This is not a user name. Please use HelixUserApi#getUserByName to fetch a user object by name. Aliased type: string | number | UserIdResolvableType | none | The ID of the user to be warned. | |
reason | string | none | A custom reason for the warning. Max 500 chars. |