Class ChatModerationAction

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

public class ChatModerationAction
extends java.lang.Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  ChatModerationAction.ModerationAction  
    static class  ChatModerationAction.ModerationType  
  • Constructor Summary

    Constructors
    Constructor Description
    ChatModerationAction()  
  • Method Summary

    Modifier and Type Method Description
    protected boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    java.util.List<java.lang.String> getArgs()
    The arguments passed to the moderation action command.
    java.lang.String getCreatedBy()
    The login for the account that triggered the moderation action
    java.lang.String getCreatedByUserId()
    The user id for the account that triggered the moderation action
    java.util.Optional<java.lang.String> getDeletedMessage()  
    java.util.OptionalInt getFollowersDuration()  
    java.lang.Boolean getFromAutomod()
    Whether the moderation action was triggered by AutoMod
    ChatModerationAction.ModerationAction getModerationAction()
    The specific moderation action that took place, in a convenient enum form
    ChatModerationAction.ModerationType getModType()
    The specific moderation type that took place, in a convenient enum form
    java.lang.String getMsgId()
    The relevant message id, if the action was a message deletion
    java.util.Optional<java.lang.String> getReason()  
    java.util.OptionalInt getSlowDuration()  
    java.util.Optional<java.lang.String> getTargetedUserName()  
    java.lang.String getTargetUserId()
    The user id for the targeted account by the moderation action (e.g. the user id that was banned)
    java.lang.String getTargetUserLogin()
    The user name for the targeted account by the moderation action (e.g. the user login that was banned)
    java.util.OptionalInt getTimeoutDuration()  
    java.lang.String getType()
    The raw string for the class of moderation action.
    int hashCode()  
    void setArgs​(java.util.List<java.lang.String> args)
    The arguments passed to the moderation action command.
    void setCreatedBy​(java.lang.String createdBy)
    The login for the account that triggered the moderation action
    void setCreatedByUserId​(java.lang.String createdByUserId)
    The user id for the account that triggered the moderation action
    void setFromAutomod​(java.lang.Boolean fromAutomod)
    Whether the moderation action was triggered by AutoMod
    void setModerationAction​(ChatModerationAction.ModerationAction moderationAction)
    The specific moderation action that took place, in a convenient enum form
    void setMsgId​(java.lang.String msgId)
    The relevant message id, if the action was a message deletion
    void setTargetUserId​(java.lang.String targetUserId)
    The user id for the targeted account by the moderation action (e.g. the user id that was banned)
    void setTargetUserLogin​(java.lang.String targetUserLogin)
    The user name for the targeted account by the moderation action (e.g. the user login that was banned)
    void setType​(java.lang.String type)
    The raw string for the class of moderation action.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • ChatModerationAction

      public ChatModerationAction()
  • Method Details

    • getTargetedUserName

      public java.util.Optional<java.lang.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 java.util.Optional<java.lang.String> getReason()
      Returns:
      optional wrapper around the reason associated with the ban or timeout (or an empty string if none was specified)
    • getDeletedMessage

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

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

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

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

      public java.lang.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:
      getModType()
    • getModerationAction

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

      public java.util.List<java.lang.String> getArgs()
      The arguments passed to the moderation action command. Can be null.
      See Also:
      getTargetedUserName(), getReason(), getDeletedMessage(), getTimeoutDuration(), getSlowDuration(), getFollowersDuration()
    • getCreatedBy

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

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

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

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

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

      public void setType​(java.lang.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:
      getModType()
    • setModerationAction

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

      public void setArgs​(java.util.List<java.lang.String> args)
      The arguments passed to the moderation action command. Can be null.
      See Also:
      getTargetedUserName(), getReason(), getDeletedMessage(), getTimeoutDuration(), getSlowDuration(), getFollowersDuration()
    • setCreatedBy

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

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

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

      public void setTargetUserId​(java.lang.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​(java.lang.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​(java.lang.Boolean fromAutomod)
      Whether the moderation action was triggered by AutoMod
      See Also:
      Twitch Docs
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • canEqual

      protected boolean canEqual​(java.lang.Object other)
    • hashCode

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getModType

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