Skip to main content

Topic - Leaderboard Events

Description

This topic can be used to monitor weekly/monthly leaderboard events of a specified channel in terms of bits used and subs gifted.

With all undocumented topics, use at your own risk.

Method Definition

NameTypeDescription
credentialOAuth2CredentialAuth Token (may not necessarily be required)
channelIdStringTarget Channel Id

Code-Snippets

Subscribe: Weekly Leaderboard Events

// One can subscribe to one or both of these:
twitchClient.getPubSub().listenForChannelBitsLeaderboardEvents(credential, "149223493");
twitchClient.getPubSub().listenForChannelSubLeaderboardEvents(credential, "149223493");

// Alternatively, this helper method can be used to subscribe to the above two topics in one line:
twitchClient.getPubSub().listenForLeaderboardEvents(credential, "149223493");

Subscribe: Monthly Leaderboard Events

// One can subscribe to one or both of these:
twitchClient.getPubSub().listenForChannelBitsLeaderboardMonthlyEvents(credential, "149223493");
twitchClient.getPubSub().listenForChannelSubLeaderboardMonthlyEvents(credential, "149223493");

// Alternatively, this helper method can be used to subscribe to the above two topics in one line:
twitchClient.getPubSub().listenForLeaderboardMonthlyEvents(credential, "149223493");

Listen: Bits Leaderboard Update

twitchClient.getEventManager().onEvent(BitsLeaderboardEvent.class, System.out::println);

Listen: Sub Gifts Leaderboard Update

twitchClient.getEventManager().onEvent(SubLeaderboardEvent.class, System.out::println);