Class IRCMessageEvent
java.lang.Object
com.github.philippheuer.events4j.core.domain.Event
com.github.twitch4j.chat.events.TwitchEvent
com.github.twitch4j.chat.events.channel.IRCMessageEvent
- All Implemented Interfaces:
com.github.philippheuer.events4j.api.domain.IEvent
This event gets called when we receive a raw irc message.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIRCMessageEvent(String rawMessage, Map<String, String> channelIdToChannelName, Map<String, String> channelNameToChannelId, Collection<String> botOwnerIds) Event Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanMetadata related to the chat badges in the badges tagBadgesGet ChatChannelChannel IdChannel NameClientClient PermissionsMessage TypegetFlags()AutoMod Message Flag Indicators, relevant for PRIVMSG and USERNOTICEMessageThe message UUID that is used for deletion by a moderator or a chat reply (from Tags)getNonce()IRC Command PayloadRAW MessageRaw TagsgetTags()TagsgetTagValue(String tagName) Gets a optional tag from the irc messageGet Target UserGets the Target User Id (from Tags)getUser()Get UserGets the User Id (from Tags)Gets the User Name (from Tags)inthashCode()isValid()Checks if the Event was parsed correctly.parseClientName(String raw) Gets the ClientName from the IRC User Identifier (:user!user@user.tmi.twitch.tv)Parse Tags from raw listtoString()Methods inherited from class com.github.twitch4j.chat.events.TwitchEvent
getTwitchChatMethods inherited from class com.github.philippheuer.events4j.core.domain.Event
getEventId, getFiredAt, getFiredAtInstant, getServiceMediator, setEventId, setFiredAt, setFiredAtInstant, setServiceMediator
-
Field Details
-
NONCE_TAG_NAME
- See Also:
-
-
Constructor Details
-
IRCMessageEvent
public IRCMessageEvent(String rawMessage, Map<String, String> channelIdToChannelName, Map<String, String> channelNameToChannelId, Collection<String> botOwnerIds) Event Constructor- Parameters:
rawMessage- The raw message.channelIdToChannelName- Mapping used to lookup a missing channel name in the eventchannelNameToChannelId- Mapping used to lookup a missing channel id in the eventbotOwnerIds- The bot owner ids.
-
-
Method Details
-
isValid
Checks if the Event was parsed correctly.- Returns:
- Is the Event valid?
-
parseTags
Parse Tags from raw list- Parameters:
raw- The raw list of tags.- Returns:
- A key-value map of the tags.
-
parseClientName
Gets the ClientName from the IRC User Identifier (:user!user@user.tmi.twitch.tv)- Parameters:
raw- Raw ClientName- Returns:
- Client name, or empty.
-
getUserId
Gets the User Id (from Tags)- Returns:
- Long userId
-
getUserName
Gets the User Name (from Tags)- Returns:
- String userName
-
getTargetUserId
Gets the Target User Id (from Tags)- Returns:
- Long targetUserId
-
getMessageId
The message UUID that is used for deletion by a moderator or a chat reply (from Tags)- Returns:
- the unique ID for the message
-
getNonce
- Returns:
- the client nonce for the message.
-
getSubscriberMonths
- Returns:
- the exact number of months the user has been a subscriber, or empty if they are not subscribed
-
getSubscriptionTier
- Returns:
- the tier at which the user is subscribed, or empty if they are not subscribed
-
getCheererTier
- Returns:
- the tier of the bits badge of the user, or empty if there is no bits badge present (which can also occur for bits leaders)
-
getPredictedChoiceIndex
- Returns:
- the index of the choice this user is predicting, in an optional wrapper
-
getPredictedChoiceTitle
- Returns:
- the title of the choice this user is predicting, in an optional wrapper
-
getTagValue
Gets a optional tag from the irc message- Parameters:
tagName- The tag of the irc message- Returns:
- String tagValue
-
getUser
Get User- Returns:
- ChatUser
-
getTargetUser
Get Target User- Returns:
- ChatUser
-
getChannel
Get ChatChannel- Returns:
- ChatChannel
-
toString
- Overrides:
toStringin classTwitchEvent
-
getTags
Tags -
getRawTags
Raw Tags -
getBadges
Badges -
getBadgeInfo
Metadata related to the chat badges in the badges tag -
getClientName
Client -
getCommandType
Message Type -
getChannelId
Channel Id -
getChannelName
Channel Name -
getMessage
Message -
getPayload
IRC Command Payload -
getClientPermissions
Client Permissions -
getRawMessage
RAW Message -
equals
- Overrides:
equalsin classTwitchEvent
-
canEqual
- Overrides:
canEqualin classTwitchEvent
-
hashCode
public int hashCode()- Overrides:
hashCodein classTwitchEvent
-
getFlags
AutoMod Message Flag Indicators, relevant for PRIVMSG and USERNOTICE
-