TwurpleAuthenticationGetting dataExamplesFAQMigration

Main classes

HelixModerationApi

The Helix API methods that deal with moderation.

Overview

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)

async

Adds 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.

ParameterTypeRequiredDefaultDescription
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.

textstringnone

The word or phrase to block from being used in the broadcaster's channel.

Return type: HelixBlockedTerm[]

addModerator(broadcaster, user)

async

Adds a moderator to the broadcaster’s chat room.

ParameterTypeRequiredDefaultDescription
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.

Return type: void

banUser(broadcaster, data)

async

Bans 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.

ParameterTypeRequiredDefaultDescription
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.

dataHelixBanUserRequestnonesee below
data.durationnumbernone

The duration (in seconds) that the user should be timed out. If this value is null, the user will be banned.

data.reasonstringnone

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.

Return type: HelixBanUser[]

checkAutoModStatus(channel, data)

async

Determines whether a string message meets the channel's AutoMod requirements.

ParameterTypeRequiredDefaultDescription
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.

dataHelixCheckAutoModStatusData[]none

An array of message data objects.

Return type: HelixAutoModStatus[]

checkUserBan(channel, user)

async

Checks whether a given user is banned in a given channel.

ParameterTypeRequiredDefaultDescription
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.

Return type: boolean

checkUserMod(channel, user)

async

Checks whether a given user is a moderator of a given channel.

ParameterTypeRequiredDefaultDescription
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.

Return type: boolean

deleteChatMessages(broadcaster, messageId)

async

Removes 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.

ParameterTypeRequiredDefaultDescription
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.

messageIdstringnone

The ID of the message to remove. If not specified, the request removes all messages in the broadcaster’s chat room.

Return type: void

getAutoModSettings(broadcaster)

async

Gets 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.

ParameterTypeRequiredDefaultDescription
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.

Return type: HelixAutoModSettings[]

getBannedUsers(channel, filter)

async

Gets a list of banned users in a given channel.

ParameterTypeRequiredDefaultDescription
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.

filterHelixBanFilternone

Additional filters for the result set.

filter.afterstringnone

A cursor to get the following page of.

filter.limitnumbernone

The number of results per page.

filter.userIdstring | string[]none

A user ID or a list thereof.

getBannedUsersPaginated(channel)

Creates a paginator for banned users in a given channel.

ParameterTypeRequiredDefaultDescription
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.

Return type: HelixPaginatedRequest<HelixBanData, HelixBan>

getBlockedTerms(broadcaster, pagination)

async

Gets 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.

ParameterTypeRequiredDefaultDescription
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.

paginationHelixForwardPaginationnonesee below
pagination.afterstringnone

A cursor to get the following page of.

pagination.limitnumbernone

The number of results per page.

getModeratedChannels(user, filter)

async

Gets a list of channels where the specified user has moderator privileges.

ParameterTypeRequiredDefaultDescription
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.

filterHelixForwardPaginationnonesee below
filter.afterstringnone

A cursor to get the following page of.

filter.limitnumbernone

The number of results per page.

getModeratedChannelsPaginated(user)

Creates a paginator for channels where the specified user has moderator privileges.

ParameterTypeRequiredDefaultDescription
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.

Return type: HelixPaginatedRequest<HelixModeratedChannelData, HelixModeratedChannel>

getModerators(channel, filter)

async

Gets a list of moderators in a given channel.

ParameterTypeRequiredDefaultDescription
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.

filterHelixModeratorFilternone

Additional filters for the result set.

filter.afterstringnone

A cursor to get the following page of.

filter.limitnumbernone

The number of results per page.

filter.userIdstring | string[]none

A user ID or a list thereof.

getModeratorsPaginated(channel)

Creates a paginator for moderators in a given channel.

ParameterTypeRequiredDefaultDescription
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.

Return type: HelixPaginatedRequest<HelixModeratorData, HelixModerator>

getShieldModeStatus(broadcaster)

async

Gets the broadcaster's Shield Mode activation status.

ParameterTypeRequiredDefaultDescription
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.

processHeldAutoModMessage(user, msgId, allow)

async

Processes a message held by AutoMod.

ParameterTypeRequiredDefaultDescription
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.

msgIdstringnone

The ID of the message.

allowbooleannone

Whether to allow the message - true allows, and false denies.

Return type: void

removeBlockedTerm(broadcaster, moderator, id)

async

Removes a blocked term from the broadcaster's channel.

ParameterTypeRequiredDefaultDescription
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.

idstringnone

The ID of the term that should be unblocked.

Return type: void

removeModerator(broadcaster, user)

async

Removes a moderator from the broadcaster’s chat room.

ParameterTypeRequiredDefaultDescription
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.

Return type: void

unbanUser(broadcaster, user)

async

Unbans/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.

ParameterTypeRequiredDefaultDescription
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.

Return type: void

updateAutoModSettings(broadcaster, data)

async

Updates 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.

ParameterTypeRequiredDefaultDescription
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.

dataHelixAutoModSettingsUpdatenone

The updated AutoMod settings that replace the current AutoMod settings.

Return type: HelixAutoModSettings[]

updateShieldModeStatus(broadcaster, activate)

async

Activates 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.

ParameterTypeRequiredDefaultDescription
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.

activatebooleannone

The desired Shield Mode status on the broadcaster's channel.