Class ChannelMessageEvent

java.lang.Object
com.github.philippheuer.events4j.core.domain.Event
All Implemented Interfaces:
com.github.philippheuer.events4j.api.domain.IEvent

public final class ChannelMessageEvent
extends AbstractChannelEvent
This event gets called when a message is received in a channel.
  • Constructor Summary

    Constructors
    Constructor Description
    ChannelMessageEvent​(com.github.twitch4j.common.events.domain.EventChannel channel, IRCMessageEvent messageEvent, com.github.twitch4j.common.events.domain.EventUser user, java.lang.String message, java.util.Set<com.github.twitch4j.common.enums.CommandPermission> permissions)
    Event Constructor
  • Method Summary

    Modifier and Type Method Description
    protected boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    @Nullable ChatCrowdChant getChantInfo()
    Information regarding any associated Crowd Chant for this message, if applicable.
    java.util.Optional<java.lang.String> getCustomRewardId()  
    java.util.List<AutoModFlag> getFlags()  
    java.lang.String getMessage()
    Message
    IRCMessageEvent getMessageEvent()
    RAW Message Event
    java.lang.String getNonce()
    Nonce
    java.util.Set<com.github.twitch4j.common.enums.CommandPermission> getPermissions()
    Permissions of the user
    @Nullable com.github.twitch4j.common.util.ChatReply getReplyInfo()
    Information regarding the parent message being replied to, if applicable.
    int getSubscriberMonths()
    The exact number of months the user has been a subscriber, or zero if not subscribed
    int getSubscriptionTier()
    The tier at which the user is subscribed (prime is treated as 1), or zero if not subscribed
    com.github.twitch4j.common.events.domain.EventUser getUser()
    User
    int hashCode()  
    boolean isHighlightedMessage()  
    boolean isSkipSubsModeMessage()  
    java.lang.String toString()  

    Methods inherited from class com.github.twitch4j.chat.events.AbstractChannelEvent

    ban, getChannel, timeout, unban

    Methods inherited from class com.github.twitch4j.chat.events.TwitchEvent

    getTwitchChat

    Methods inherited from class com.github.philippheuer.events4j.core.domain.Event

    getEventId, getFiredAt, getFiredAtInstant, getServiceMediator, setEventId, setFiredAt, setFiredAtInstant, setServiceMediator

    Methods inherited from class java.lang.Object

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

    • ChannelMessageEvent

      public ChannelMessageEvent​(com.github.twitch4j.common.events.domain.EventChannel channel, IRCMessageEvent messageEvent, com.github.twitch4j.common.events.domain.EventUser user, java.lang.String message, java.util.Set<com.github.twitch4j.common.enums.CommandPermission> permissions)
      Event Constructor
      Parameters:
      channel - The channel that this event originates from.
      messageEvent - The raw message event
      user - The user who triggered the event.
      message - The plain text of the message.
      permissions - The permissions of the triggering user.
  • Method Details

    • isHighlightedMessage

      @Unofficial public boolean isHighlightedMessage()
      Returns:
      whether "Highlight My Message" was redeemed for this event
    • isSkipSubsModeMessage

      @Unofficial public boolean isSkipSubsModeMessage()
      Returns:
      whether "Send a Message in Sub-Only Mode" was redeemed for this event
    • getCustomRewardId

      @Unofficial public java.util.Optional<java.lang.String> getCustomRewardId()
      Returns:
      the id for the custom reward that was redeemed with this associated message, in an optional wrapper
    • getFlags

      @Unofficial public java.util.List<AutoModFlag> getFlags()
      Returns:
      the regions of the message that were flagged by AutoMod.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class AbstractChannelEvent
    • getMessageEvent

      public IRCMessageEvent getMessageEvent()
      RAW Message Event
    • getUser

      public com.github.twitch4j.common.events.domain.EventUser getUser()
      User
    • getMessage

      public java.lang.String getMessage()
      Message
    • getPermissions

      public java.util.Set<com.github.twitch4j.common.enums.CommandPermission> getPermissions()
      Permissions of the user
    • getSubscriberMonths

      public int getSubscriberMonths()
      The exact number of months the user has been a subscriber, or zero if not subscribed
    • getSubscriptionTier

      public int getSubscriptionTier()
      The tier at which the user is subscribed (prime is treated as 1), or zero if not subscribed
    • equals

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

      protected boolean canEqual​(java.lang.Object other)
      Overrides:
      canEqual in class AbstractChannelEvent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractChannelEvent
    • getNonce

      public java.lang.String getNonce()
      Nonce
    • getReplyInfo

      @Nullable public @Nullable com.github.twitch4j.common.util.ChatReply getReplyInfo()
      Information regarding the parent message being replied to, if applicable.
    • getChantInfo

      @Nullable public @Nullable ChatCrowdChant getChantInfo()
      Information regarding any associated Crowd Chant for this message, if applicable.