Skip to main content

Topic - User Community Points Events

Description

This topic can be used to monitor events regarding a specified user's community points.

The topic is analogous to the documented PubSub > Channel Points Events, but from the perspective of the user (who may be in multiple channels).

With all undocumented topics, use at your own risk.

Method Definition

NameTypeDescription
credentialOAuth2CredentialUser Auth Token for the target user id (scope undocumented)
userIdStringTarget User Id

Code-Snippets

Subscribe to all user community points events for twitch4j and register a listener that prints all messages to console

// Subscribe to topic
twitchClient.getPubSub().listenForUserChannelPointsEvents(credential, "149223493");

// Register event listeners
twitchClient.getEventManager().onEvent(PointsEarnedEvent.class, System.out::println);
twitchClient.getEventManager().onEvent(ClaimAvailableEvent.class, System.out::println);
twitchClient.getEventManager().onEvent(ClaimClaimedEvent.class, System.out::println);
twitchClient.getEventManager().onEvent(PointsSpentEvent.class, System.out::println);
twitchClient.getEventManager().onEvent(RewardRedeemedEvent.class, System.out::println);