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 classChatModerationAction.ModerationActionstatic classChatModerationAction.ModerationType -
Constructor Summary
Constructors Constructor Description ChatModerationAction() -
Method Summary
Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.util.List<java.lang.String>getArgs()The arguments passed to the moderation action command.java.lang.StringgetCreatedBy()The login for the account that triggered the moderation actionjava.lang.StringgetCreatedByUserId()The user id for the account that triggered the moderation actionjava.util.Optional<java.lang.String>getDeletedMessage()java.util.OptionalIntgetFollowersDuration()java.lang.BooleangetFromAutomod()Whether the moderation action was triggered by AutoModChatModerationAction.ModerationActiongetModerationAction()The specific moderation action that took place, in a convenient enum formChatModerationAction.ModerationTypegetModType()The specific moderation type that took place, in a convenient enum formjava.lang.StringgetMsgId()The relevant message id, if the action was a message deletionjava.util.Optional<java.lang.String>getReason()java.util.OptionalIntgetSlowDuration()java.util.Optional<java.lang.String>getTargetedUserName()java.lang.StringgetTargetUserId()The user id for the targeted account by the moderation action (e.g. the user id that was banned)java.lang.StringgetTargetUserLogin()The user name for the targeted account by the moderation action (e.g. the user login that was banned)java.util.OptionalIntgetTimeoutDuration()java.lang.StringgetType()The raw string for the class of moderation action.inthashCode()voidsetArgs(java.util.List<java.lang.String> args)The arguments passed to the moderation action command.voidsetCreatedBy(java.lang.String createdBy)The login for the account that triggered the moderation actionvoidsetCreatedByUserId(java.lang.String createdByUserId)The user id for the account that triggered the moderation actionvoidsetFromAutomod(java.lang.Boolean fromAutomod)Whether the moderation action was triggered by AutoModvoidsetModerationAction(ChatModerationAction.ModerationAction moderationAction)The specific moderation action that took place, in a convenient enum formvoidsetMsgId(java.lang.String msgId)The relevant message id, if the action was a message deletionvoidsetTargetUserId(java.lang.String targetUserId)The user id for the targeted account by the moderation action (e.g. the user id that was banned)voidsetTargetUserLogin(java.lang.String targetUserLogin)The user name for the targeted account by the moderation action (e.g. the user login that was banned)voidsetType(java.lang.String type)The raw string for the class of moderation action.java.lang.StringtoString()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
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. -
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
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. -
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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other) -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getModType
The specific moderation type that took place, in a convenient enum form
-