Class ChatModerationAction

java.lang.Object
com.github.twitch4j.pubsub.domain.ChatModerationAction

public class ChatModerationAction extends Object
  • Constructor Details

    • ChatModerationAction

      public ChatModerationAction()
    • ChatModerationAction

      public ChatModerationAction(String type, ChatModerationAction.ModerationAction moderationAction, List<String> args, String createdBy, String createdByUserId, String msgId, String targetUserId, String targetUserLogin, Boolean fromAutomod)
      Creates a new ChatModerationAction instance.
      Parameters:
      type - The raw string for the class of moderation action. Can be "chat_channel_moderation" or "chat_login_moderation" or "chat_targeted_login_moderation"
      moderationAction - The specific moderation action that took place, in a convenient enum form
      args - The arguments passed to the moderation action command. Can be null.
      createdBy - The login for the account that triggered the moderation action
      createdByUserId - The user id for the account that triggered the moderation action
      msgId - The relevant message id, if the action was a message deletion
      targetUserId - The user id for the targeted account by the moderation action (e.g. the user id that was banned)
      targetUserLogin - The user name for the targeted account by the moderation action (e.g. the user login that was banned)

      Note: While this field is included in the pubsub response, the API appears to never populate it with a non-empty string

      fromAutomod - Whether the moderation action was triggered by AutoMod
      See Also:
  • Method Details

    • getTargetedUserName

      public Optional<String> getTargetedUserName()
      Returns:
      optional wrapper around the username that was specified in a ban, unban, timeout, untimeout, vip, unvip, mod, unmod, host, raid, or delete message command
    • getReason

      public Optional<String> getReason()
      Returns:
      optional wrapper around the reason associated with the ban or timeout (or an empty string if none was specified)
    • getDeletedMessage

      public Optional<String> getDeletedMessage()
      Returns:
      optional wrapper around the message that was deleted
    • getTimeoutDuration

      public OptionalInt getTimeoutDuration()
      Returns:
      optional wrapper around the duration the user was timed out for, in seconds
    • getSlowDuration

      public OptionalInt getSlowDuration()
      Returns:
      optional wrapper around the slow mode delay, in seconds
    • getFollowersDuration

      public OptionalInt getFollowersDuration()
      Returns:
      optional wrapper around the duration followers only mode was set to, in minutes
    • getType

      public String getType()
      The raw string for the class of moderation action. Can be "chat_channel_moderation" or "chat_login_moderation" or "chat_targeted_login_moderation"
      See Also:
    • getModerationAction

      public ChatModerationAction.ModerationAction getModerationAction()
      The specific moderation action that took place, in a convenient enum form
    • getArgs

      public List<String> getArgs()
      The arguments passed to the moderation action command. Can be null.
      See Also:
    • getCreatedBy

      public String getCreatedBy()
      The login for the account that triggered the moderation action
    • getCreatedByUserId

      public String getCreatedByUserId()
      The user id for the account that triggered the moderation action
    • getMsgId

      public String getMsgId()
      The relevant message id, if the action was a message deletion
    • getTargetUserId

      public String getTargetUserId()
      The user id for the targeted account by the moderation action (e.g. the user id that was banned)
    • getTargetUserLogin

      public String getTargetUserLogin()
      The user name for the targeted account by the moderation action (e.g. the user login that was banned)

      Note: While this field is included in the pubsub response, the API appears to never populate it with a non-empty string

    • getFromAutomod

      public Boolean getFromAutomod()
      Whether the moderation action was triggered by AutoMod
      See Also:
    • 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
    • setType

      @Deprecated public void setType(String type)
      Deprecated.
      The raw string for the class of moderation action. Can be "chat_channel_moderation" or "chat_login_moderation" or "chat_targeted_login_moderation"
      See Also:
    • setModerationAction

      @Deprecated public void setModerationAction(ChatModerationAction.ModerationAction moderationAction)
      Deprecated.
      The specific moderation action that took place, in a convenient enum form
    • setArgs

      @Deprecated public void setArgs(List<String> args)
      Deprecated.
      The arguments passed to the moderation action command. Can be null.
      See Also:
    • setCreatedBy

      @Deprecated public void setCreatedBy(String createdBy)
      Deprecated.
      The login for the account that triggered the moderation action
    • setCreatedByUserId

      @Deprecated public void setCreatedByUserId(String createdByUserId)
      Deprecated.
      The user id for the account that triggered the moderation action
    • setMsgId

      @Deprecated public void setMsgId(String msgId)
      Deprecated.
      The relevant message id, if the action was a message deletion
    • setTargetUserId

      @Deprecated public void setTargetUserId(String targetUserId)
      Deprecated.
      The user id for the targeted account by the moderation action (e.g. the user id that was banned)
    • setTargetUserLogin

      @Deprecated public void setTargetUserLogin(String targetUserLogin)
      Deprecated.
      The user name for the targeted account by the moderation action (e.g. the user login that was banned)

      Note: While this field is included in the pubsub response, the API appears to never populate it with a non-empty string

    • setFromAutomod

      @Deprecated public void setFromAutomod(Boolean fromAutomod)
      Deprecated.
      Whether the moderation action was triggered by AutoMod
      See Also:
    • getModType

      The specific moderation type that took place, in a convenient enum form