Interface ITwitchPubSub

All Superinterfaces:
java.lang.AutoCloseable
All Known Implementing Classes:
TwitchPubSub, TwitchPubSubConnectionPool

public interface ITwitchPubSub
extends java.lang.AutoCloseable
  • Method Details

    • getEventManager

      com.github.philippheuer.events4j.core.EventManager getEventManager()
    • listenOnTopic

      PubSubSubscription listenOnTopic​(PubSubRequest request)
      Send WS Message to subscribe to a topic
      Parameters:
      request - Topic
      Returns:
      PubSubSubscription to be listened to
    • unsubscribeFromTopic

      boolean unsubscribeFromTopic​(PubSubSubscription subscription)
      Unsubscribe from a topic. Usage example:
            PubSubSubscription subscription = twitchPubSub.listenForCheerEvents(...);
            // ...
            twitchPubSub.unsubscribeFromTopic(subscription);
       
      Parameters:
      subscription - PubSubSubscription to be unlistened from
      Returns:
      whether the subscription was previously subscribed to
    • close

      void close()
      Specified by:
      close in interface java.lang.AutoCloseable
    • listenOnTopic

      default PubSubSubscription listenOnTopic​(PubSubType type, com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.util.Collection<java.lang.String> topics)
    • listenOnTopic

      default PubSubSubscription listenOnTopic​(PubSubType type, com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String topic)
    • listenOnTopic

      default PubSubSubscription listenOnTopic​(PubSubType type, com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String... topics)
    • listenForAutomodQueueEvents

      default PubSubSubscription listenForAutomodQueueEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId, java.lang.String channelId)
      Event Listener: AutoMod flags a message as potentially inappropriate, and when a moderator takes action on a message.
      Parameters:
      credential - Credential (for userId, scope: channel:moderate)
      userId - The moderator's user id associated with the credential
      channelId - The user id associated with the target channel
      Returns:
      PubSubSubscription
    • listenForBitsBadgeEvents

      default PubSubSubscription listenForBitsBadgeEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Event Listener: User earned a new Bits badge and shared the notification with chat
      Parameters:
      credential - Credential (for target channel id, scope: bits:read)
      channelId - Target Channel Id
      Returns:
      PubSubSubscription
    • listenForCheerEvents

      default PubSubSubscription listenForCheerEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Event Listener: Anyone cheers on a specified channel.
      Parameters:
      credential - Credential (for target channel id, scope: bits:read)
      channelId - Target Channel Id
      Returns:
      PubSubSubscription
    • listenForSubscriptionEvents

      default PubSubSubscription listenForSubscriptionEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Event Listener: Anyone subscribes (first month), resubscribes (subsequent months), or gifts a subscription to a channel.
      Parameters:
      credential - Credential (for targetChannelId, scope: channel_subscriptions)
      channelId - Target Channel Id
      Returns:
      PubSubSubscription
    • listenForCommerceEvents

      @Deprecated default PubSubSubscription listenForCommerceEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
      Event Listener: Anyone makes a purchase on a channel.
      Parameters:
      credential - Credential (any)
      channelId - Target Channel Id
      Returns:
      PubSubSubscription
    • listenForWhisperEvents

      default PubSubSubscription listenForWhisperEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Event Listener: Anyone whispers the specified user.
      Parameters:
      credential - Credential (for targetUserId, scope: whispers:read)
      userId - Target User Id
      Returns:
      PubSubSubscription
    • listenForModerationEvents

      @Deprecated @Unofficial default PubSubSubscription listenForModerationEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
      in favor of listenForModerationEvents(OAuth2Credential, String, String)
      Event Listener: A moderator performs an action in the channel
      Parameters:
      credential - Credential (for channelId, scope: channel:moderate)
      channelId - Target Channel Id
      Returns:
      PubSubSubscription
    • listenForModerationEvents

      default PubSubSubscription listenForModerationEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId, java.lang.String channelId)
      Event Listener: A moderator performs an action in the channel
      Parameters:
      credential - Credential (for userId, scope: channel:moderate)
      userId - The user id associated with the credential
      channelId - The user id associated with the target channel
      Returns:
      PubSubSubscription
    • listenForUserModerationNotificationEvents

      default PubSubSubscription listenForUserModerationNotificationEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId, java.lang.String channelId)
      Event Listener: A user’s message held by AutoMod has been approved or denied.
      Parameters:
      credential - Credential (for userId, scope: chat:read)
      userId - The user id associated with the credential
      channelId - The user id associated with the target channel
      Returns:
      PubSubSubscription
    • listenForChannelPointsRedemptionEvents

      default PubSubSubscription listenForChannelPointsRedemptionEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Event Listener: Anyone makes a channel points redemption on a channel.
      Parameters:
      credential - Credential (with the channel:read:redemptions scope for maximum information)
      channelId - Target Channel Id
      Returns:
      PubSubSubscription
    • listenForAdsEvents

      @Unofficial @Deprecated default PubSubSubscription listenForAdsEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForAdPropertyRefreshEvents

      @Unofficial @Deprecated default PubSubSubscription listenForAdPropertyRefreshEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForAutomodLevelsModificationEvents

      @Unofficial default PubSubSubscription listenForAutomodLevelsModificationEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId, java.lang.String channelId)
    • listenForBountyBoardEvents

      @Unofficial @Deprecated default PubSubSubscription listenForBountyBoardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForDashboardActivityFeedEvents

      @Unofficial @Deprecated default PubSubSubscription listenForDashboardActivityFeedEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForCommunityBoostEvents

      @Unofficial default PubSubSubscription listenForCommunityBoostEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForCrowdChantEvents

      @Unofficial default PubSubSubscription listenForCrowdChantEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForUserChannelPointsEvents

      @Unofficial default PubSubSubscription listenForUserChannelPointsEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
    • listenForChannelDropEvents

      @Unofficial @Deprecated default PubSubSubscription listenForChannelDropEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForChannelBitsLeaderboardEvents

      @Unofficial default PubSubSubscription listenForChannelBitsLeaderboardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForChannelBitsLeaderboardMonthlyEvents

      @Unofficial default PubSubSubscription listenForChannelBitsLeaderboardMonthlyEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForChannelBitsLeaderboardEvents

      @Unofficial default PubSubSubscription listenForChannelBitsLeaderboardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId, java.lang.String timeAggregationUnit)
    • listenForChannelPrimeGiftStatusEvents

      @Unofficial @Deprecated default PubSubSubscription listenForChannelPrimeGiftStatusEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForChannelSubLeaderboardEvents

      @Unofficial default PubSubSubscription listenForChannelSubLeaderboardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForChannelSubLeaderboardMonthlyEvents

      @Unofficial default PubSubSubscription listenForChannelSubLeaderboardMonthlyEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForChannelSubLeaderboardEvents

      @Unofficial default PubSubSubscription listenForChannelSubLeaderboardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId, java.lang.String timeAggregationUnit)
    • listenForLeaderboardEvents

      @Unofficial default PubSubSubscription listenForLeaderboardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForLeaderboardMonthlyEvents

      @Unofficial default PubSubSubscription listenForLeaderboardMonthlyEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForLeaderboardEvents

      @Unofficial default PubSubSubscription listenForLeaderboardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId, java.lang.String timeAggregationUnit)
    • listenForChannelPredictionsEvents

      @Unofficial default PubSubSubscription listenForChannelPredictionsEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForUserPredictionsEvents

      @Unofficial default PubSubSubscription listenForUserPredictionsEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
    • listenForChannelSubGiftsEvents

      @Unofficial default PubSubSubscription listenForChannelSubGiftsEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForChannelSquadEvents

      @Unofficial @Deprecated default PubSubSubscription listenForChannelSquadEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForRaidEvents

      @Unofficial default PubSubSubscription listenForRaidEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForChannelUnbanRequestEvents

      @Unofficial default PubSubSubscription listenForChannelUnbanRequestEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId, java.lang.String channelId)
    • listenForUserUnbanRequestEvents

      @Unofficial default PubSubSubscription listenForUserUnbanRequestEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId, java.lang.String channelId)
    • listenForChannelExtensionEvents

      @Unofficial @Deprecated default PubSubSubscription listenForChannelExtensionEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForExtensionControlEvents

      @Unofficial @Deprecated default PubSubSubscription listenForExtensionControlEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForHypeTrainEvents

      @Unofficial default PubSubSubscription listenForHypeTrainEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForHypeTrainRewardEvents

      @Unofficial default PubSubSubscription listenForHypeTrainRewardEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForBroadcastSettingUpdateEvents

      @Unofficial @Deprecated default PubSubSubscription listenForBroadcastSettingUpdateEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForCelebrationEvents

      @Unofficial @Deprecated default PubSubSubscription listenForCelebrationEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForPublicBitEvents

      @Unofficial @Deprecated default PubSubSubscription listenForPublicBitEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForPublicCheerEvents

      @Unofficial default PubSubSubscription listenForPublicCheerEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForStreamChangeEvents

      @Unofficial @Deprecated default PubSubSubscription listenForStreamChangeEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForStreamChatRoomEvents

      @Unofficial @Deprecated default PubSubSubscription listenForStreamChatRoomEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForChannelChatroomEvents

      @Unofficial @Deprecated default PubSubSubscription listenForChannelChatroomEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.
    • listenForUserChatroomEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserChatroomEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForUserBitsUpdateEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserBitsUpdateEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForUserCampaignEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserCampaignEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForUserDropEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserDropEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForUserPropertiesUpdateEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserPropertiesUpdateEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForUserSubscribeEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserSubscribeEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForUserImageUpdateEvents

      @Unofficial @Deprecated default PubSubSubscription listenForUserImageUpdateEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
      Deprecated.
    • listenForFollowingEvents

      @Unofficial default PubSubSubscription listenForFollowingEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Event Listener: Anyone follows the specified channel.
      Parameters:
      credential - OAuth2Credential
      channelId - the id for the channel
      Returns:
      PubSubSubscription
    • listenForFriendshipEvents

      @Unofficial default PubSubSubscription listenForFriendshipEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
    • listenForOnsiteNotificationEvents

      @Unofficial default PubSubSubscription listenForOnsiteNotificationEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
    • listenForPollEvents

      @Unofficial default PubSubSubscription listenForPollEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForPresenceEvents

      @Unofficial default PubSubSubscription listenForPresenceEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String userId)
    • listenForRadioEvents

      @Unofficial default PubSubSubscription listenForRadioEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForVideoPlaybackEvents

      @Unofficial default PubSubSubscription listenForVideoPlaybackEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
    • listenForVideoPlaybackByNameEvents

      @Unofficial default PubSubSubscription listenForVideoPlaybackByNameEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelName)
    • listenForWatchPartyEvents

      @Unofficial @Deprecated default PubSubSubscription listenForWatchPartyEvents​(com.github.philippheuer.credentialmanager.domain.OAuth2Credential credential, java.lang.String channelId)
      Deprecated.