Class ChatSettings

java.lang.Object
com.github.twitch4j.helix.domain.ChatSettings

public class ChatSettings extends Object
  • Constructor Details

    • ChatSettings

      public ChatSettings()
    • ChatSettings

      public ChatSettings(String broadcasterId, Boolean isEmoteOnlyMode, Boolean isFollowersOnlyMode, @Nullable @Nullable Integer followerModeDuration, @Nullable @Nullable String moderatorId, @Nullable @Nullable Boolean hasNonModeratorChatDelay, @Nullable @Nullable Integer nonModeratorChatDelayDuration, Boolean isSlowMode, @Nullable @Nullable Integer slowModeWaitTime, Boolean isSubscribersOnlyMode, Boolean isUniqueChatMode)
      Creates a new ChatSettings instance.
      Parameters:
      broadcasterId - The ID of the broadcaster specified in the request.
      isEmoteOnlyMode - A Boolean value that determines whether chat messages must contain only emotes. Is true, if only messages that are 100% emotes are allowed; otherwise, false.
      isFollowersOnlyMode - A Boolean value that determines whether the broadcaster restricts the chat room to followers only, based on how long they’ve followed. Is true, if the broadcaster restricts the chat room to followers only; otherwise, false.
      followerModeDuration - The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room Is null if follower_mode is false.

      When setting this through the API, the possible values range from 0 (all followers) to 129600 (3 months). The default is 0.

      moderatorId - The moderator’s ID. The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.
      hasNonModeratorChatDelay - A Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room. This gives chat moderators and bots a chance to remove them before viewers can see the message.

      Is true, if the broadcaster applies a delay; otherwise, false.

      The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.

      nonModeratorChatDelayDuration - The amount of time, in seconds, that messages are delayed from appearing in chat.

      Is null if non_moderator_chat_delay is false.

      The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.

      When setting this through the API, the possible values are:

      • 2 — 2 second delay (recommended)
      • 4 — 4 second delay
      • 6 — 6 second delay
      isSlowMode - A Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.

      Is true, if the broadcaster applies a delay; otherwise, false.

      slowModeWaitTime - The amount of time, in seconds, that users need to wait between sending messages.

      Is null if slow_mode is false.

      When setting this through the API, the possible values range from 3 (three-second delay) to 120 (two-minute delay). The default is 30 seconds.

      isSubscribersOnlyMode - A Boolean value that determines whether only users that subscribe to the broadcaster’s channel can talk in the chat room.

      Is true, if the broadcaster restricts the chat room to subscribers only; otherwise, false.

      isUniqueChatMode - A Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.

      Is true, if the broadcaster requires unique messages only; otherwise, false.

      See Also:
  • Method Details

    • getFollowersOnlyLength

      @Nullable public @Nullable Duration getFollowersOnlyLength()
      Returns:
      the Duration of the followers-only period, or null if not enabled.
    • getNonModChatDelayLength

      @Nullable public @Nullable Duration getNonModChatDelayLength()
      Returns:
      the Duration of the non-moderator chat delay, or null if not present.
    • getSlowModeLength

      @Nullable public @Nullable Duration getSlowModeLength()
      Returns:
      the Duration of the slow mode, or null if not enabled.
    • builder

      public static ChatSettings.ChatSettingsBuilder builder()
    • toBuilder

    • withBroadcasterId

      public ChatSettings withBroadcasterId(String broadcasterId)
      The ID of the broadcaster specified in the request.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIsEmoteOnlyMode

      public ChatSettings withIsEmoteOnlyMode(Boolean isEmoteOnlyMode)
      A Boolean value that determines whether chat messages must contain only emotes. Is true, if only messages that are 100% emotes are allowed; otherwise, false.
      Returns:
      this.
    • withIsFollowersOnlyMode

      public ChatSettings withIsFollowersOnlyMode(Boolean isFollowersOnlyMode)
      A Boolean value that determines whether the broadcaster restricts the chat room to followers only, based on how long they’ve followed. Is true, if the broadcaster restricts the chat room to followers only; otherwise, false.
      Returns:
      this.
      See Also:
    • withFollowerModeDuration

      public ChatSettings withFollowerModeDuration(@Nullable @Nullable Integer followerModeDuration)
      The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room Is null if follower_mode is false.

      When setting this through the API, the possible values range from 0 (all followers) to 129600 (3 months). The default is 0.

      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
      See Also:
    • withModeratorId

      public ChatSettings withModeratorId(@Nullable @Nullable String moderatorId)
      The moderator’s ID. The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
      See Also:
    • withHasNonModeratorChatDelay

      public ChatSettings withHasNonModeratorChatDelay(@Nullable @Nullable Boolean hasNonModeratorChatDelay)
      A Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room. This gives chat moderators and bots a chance to remove them before viewers can see the message.

      Is true, if the broadcaster applies a delay; otherwise, false.

      The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.

      Returns:
      this.
      See Also:
    • withNonModeratorChatDelayDuration

      public ChatSettings withNonModeratorChatDelayDuration(@Nullable @Nullable Integer nonModeratorChatDelayDuration)
      The amount of time, in seconds, that messages are delayed from appearing in chat.

      Is null if non_moderator_chat_delay is false.

      The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.

      When setting this through the API, the possible values are:

      • 2 — 2 second delay (recommended)
      • 4 — 4 second delay
      • 6 — 6 second delay
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
      See Also:
    • withIsSlowMode

      public ChatSettings withIsSlowMode(Boolean isSlowMode)
      A Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.

      Is true, if the broadcaster applies a delay; otherwise, false.

      Returns:
      this.
      See Also:
    • withSlowModeWaitTime

      public ChatSettings withSlowModeWaitTime(@Nullable @Nullable Integer slowModeWaitTime)
      The amount of time, in seconds, that users need to wait between sending messages.

      Is null if slow_mode is false.

      When setting this through the API, the possible values range from 3 (three-second delay) to 120 (two-minute delay). The default is 30 seconds.

      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
      See Also:
    • withIsSubscribersOnlyMode

      public ChatSettings withIsSubscribersOnlyMode(Boolean isSubscribersOnlyMode)
      A Boolean value that determines whether only users that subscribe to the broadcaster’s channel can talk in the chat room.

      Is true, if the broadcaster restricts the chat room to subscribers only; otherwise, false.

      Returns:
      this.
    • withIsUniqueChatMode

      public ChatSettings withIsUniqueChatMode(Boolean isUniqueChatMode)
      A Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.

      Is true, if the broadcaster requires unique messages only; otherwise, false.

      Returns:
      this.
    • getBroadcasterId

      public String getBroadcasterId()
      The ID of the broadcaster specified in the request.
    • isEmoteOnlyMode

      public Boolean isEmoteOnlyMode()
      A Boolean value that determines whether chat messages must contain only emotes. Is true, if only messages that are 100% emotes are allowed; otherwise, false.
    • isFollowersOnlyMode

      public Boolean isFollowersOnlyMode()
      A Boolean value that determines whether the broadcaster restricts the chat room to followers only, based on how long they’ve followed. Is true, if the broadcaster restricts the chat room to followers only; otherwise, false.
      See Also:
    • getFollowerModeDuration

      @Nullable public @Nullable Integer getFollowerModeDuration()
      The length of time, in minutes, that the followers must have followed the broadcaster to participate in the chat room Is null if follower_mode is false.

      When setting this through the API, the possible values range from 0 (all followers) to 129600 (3 months). The default is 0.

      See Also:
    • getModeratorId

      @Nullable public @Nullable String getModeratorId()
      The moderator’s ID. The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.
      See Also:
    • hasNonModeratorChatDelay

      @Nullable public @Nullable Boolean hasNonModeratorChatDelay()
      A Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room. This gives chat moderators and bots a chance to remove them before viewers can see the message.

      Is true, if the broadcaster applies a delay; otherwise, false.

      The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.

      See Also:
    • getNonModeratorChatDelayDuration

      @Nullable public @Nullable Integer getNonModeratorChatDelayDuration()
      The amount of time, in seconds, that messages are delayed from appearing in chat.

      Is null if non_moderator_chat_delay is false.

      The response includes this field only if the request specifies a User access token that includes the moderator:read:chat_settings scope.

      When setting this through the API, the possible values are:

      • 2 — 2 second delay (recommended)
      • 4 — 4 second delay
      • 6 — 6 second delay
      See Also:
    • isSlowMode

      public Boolean isSlowMode()
      A Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.

      Is true, if the broadcaster applies a delay; otherwise, false.

      See Also:
    • getSlowModeWaitTime

      @Nullable public @Nullable Integer getSlowModeWaitTime()
      The amount of time, in seconds, that users need to wait between sending messages.

      Is null if slow_mode is false.

      When setting this through the API, the possible values range from 3 (three-second delay) to 120 (two-minute delay). The default is 30 seconds.

      See Also:
    • isSubscribersOnlyMode

      public Boolean isSubscribersOnlyMode()
      A Boolean value that determines whether only users that subscribe to the broadcaster’s channel can talk in the chat room.

      Is true, if the broadcaster restricts the chat room to subscribers only; otherwise, false.

    • isUniqueChatMode

      public Boolean isUniqueChatMode()
      A Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.

      Is true, if the broadcaster requires unique messages only; otherwise, false.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object