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
Name | Type | Description |
---|---|---|
credential | OAuth2Credential | User Auth Token for the target user id (scope undocumented) |
userId | String | Target User Id |
Code-Snippets
Subscribe to all user community points events for twitch4j
and register a listener that prints all messages to console
- Java
- Kotlin
- Groovy
// 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);
// Subscribe to topic
twitchClient.pubSub.listenForUserChannelPointsEvents(credential, "149223493");
// Register event listeners
twitchClient.eventManager.onEvent(PointsEarnedEvent::class.java, System.out::println);
twitchClient.eventManager.onEvent(ClaimAvailableEvent::class.java, System.out::println);
twitchClient.eventManager.onEvent(ClaimClaimedEvent::class.java, System.out::println);
twitchClient.eventManager.onEvent(PointsSpentEvent::class.java, System.out::println);
twitchClient.eventManager.onEvent(RewardRedeemedEvent::class.java, System.out::println);
// Subscribe to topic
twitchClient.pubSub.listenForUserChannelPointsEvents(credential, "149223493");
// Register event listeners
twitchClient.eventManager.onEvent(PointsEarnedEvent, System.out::println);
twitchClient.eventManager.onEvent(ClaimAvailableEvent, System.out::println);
twitchClient.eventManager.onEvent(ClaimClaimedEvent, System.out::println);
twitchClient.eventManager.onEvent(PointsSpentEvent, System.out::println);
twitchClient.eventManager.onEvent(RewardRedeemedEvent, System.out::println);