Overview
Methods
- addBlockedTerma
- addModeratora
- banUsera
- checkAutoModStatusa
- checkUserBana
- checkUserModa
- deleteChatMessagesa
- getAutoModSettingsa
- getBannedUsersa
- getBannedUsersPaginated
- getBlockedTermsa
- getModeratedChannelsa
- getModeratedChannelsPaginated
- getModeratorsa
- getModeratorsPaginated
- getShieldModeStatusa
- processHeldAutoModMessagea
- removeBlockedTerma
- removeModeratora
- unbanUsera
- updateAutoModSettingsa
- updateShieldModeStatusa
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. |
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. |
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. |