Class ChatModerationAction

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

public class ChatModerationAction extends Object
  • Constructor Details

  • 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:
    • setType

      public void setType(String type)
      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

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

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

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

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

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

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

      public void setTargetUserLogin(String 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

    • setFromAutomod

      public void setFromAutomod(Boolean fromAutomod)
      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
    • getModType

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