Skip to main content

Topic - Moderation Events

Description

This topic can be used to monitor whenever a moderation performs an action in the specified channel.

Method Definition

Required Parameters

NameTypeDescription
credentialOAuth2CredentialUser Auth Token for the target user id, with the scope channel:moderate
channelIdStringTarget Channel Id

Optional Parameters

None

Code-Snippets

Example: User hexafice subscribes to moderation events in channel twitch4j

// Listen to topic
String userId = "142621956"; // user id of hexafice
String broadcasterId = "149223493"; // channel id of twitch4j
twitchClient.getPubSub().listenForModerationEvents(credential, broadcasterId, userId);

// Handle events
twitchClient.getEventManager().onEvent(ChatModerationEvent.class, System.out::println);