Class ChannelSubscriptionTopic

java.lang.Object
com.github.twitch4j.helix.webhooks.topics.TwitchWebhookTopic<SubscriptionEventList>
com.github.twitch4j.helix.webhooks.topics.ChannelSubscriptionTopic

public class ChannelSubscriptionTopic
extends TwitchWebhookTopic<SubscriptionEventList>
This webhook notifies you when:
  • A payment has been processed for a subscription or unsubscription.
  • A user who is subscribed to a broadcaster notifies the broadcaster of their subscription in the chat.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.github.twitch4j.helix.webhooks.topics.TwitchWebhookTopic

    TwitchWebhookTopic.UnknownTopic
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String PATH  
  • Constructor Summary

    Constructors
    Constructor Description
    ChannelSubscriptionTopic​(@NonNull java.lang.String broadcasterId, java.lang.String userId)
    This webhook notifies you when: A payment has been processed for a subscription or unsubscription.
    ChannelSubscriptionTopic​(@NonNull java.lang.String broadcasterId, java.lang.String userId, java.lang.String gifterId, java.lang.String gifterName)
    This webhook notifies you when: A payment has been processed for a subscription or unsubscription.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getBroadcasterId()  
    java.util.Optional<java.lang.String> getGifterId()  
    java.util.Optional<java.lang.String> getGifterName()  
    java.util.Optional<java.lang.String> getUserId()  

    Methods inherited from class com.github.twitch4j.helix.webhooks.topics.TwitchWebhookTopic

    canEqual, equals, fromUrl, getType, hashCode, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ChannelSubscriptionTopic

      public ChannelSubscriptionTopic​(@NonNull @NonNull java.lang.String broadcasterId, java.lang.String userId)
      This webhook notifies you when:
      • A payment has been processed for a subscription or unsubscription.
      • A user who is subscribed to a broadcaster notifies the broadcaster of their subscription in the chat.
      Parameters:
      broadcasterId - Required. User ID of the broadcaster. Must match the User ID in the Bearer token.
      userId - Optional. ID of the subscribed user. Currently only one user_id at a time can be queried.
    • ChannelSubscriptionTopic

      public ChannelSubscriptionTopic​(@NonNull @NonNull java.lang.String broadcasterId, java.lang.String userId, java.lang.String gifterId, java.lang.String gifterName)
      This webhook notifies you when:
      • A payment has been processed for a subscription or unsubscription.
      • A user who is subscribed to a broadcaster notifies the broadcaster of their subscription in the chat.
      Parameters:
      broadcasterId - Required. User ID of the broadcaster. Must match the User ID in the Bearer token.
      userId - Optional. ID of the subscribed user.
      gifterId - Optional. ID of the user who gifted the sub. Returns an empty string for non-gifts, "274598607" for anonymous gifts
      gifterName - Optional. Display name of the user who gifted the sub. Returns an empty string for non-gifts, "AnAnonymousGifter" for anonymous gifts
  • Method Details

    • getBroadcasterId

      public java.lang.String getBroadcasterId()
      Returns:
      The user ID of the broadcaster.
    • getUserId

      public java.util.Optional<java.lang.String> getUserId()
      Returns:
      The ID of the subscribed user.
    • getGifterId

      public java.util.Optional<java.lang.String> getGifterId()
      Returns:
      ID of the user who gifted the sub.
    • getGifterName

      public java.util.Optional<java.lang.String> getGifterName()
      Returns:
      Display name of the user who gifted the sub.