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
-
Constructor Summary
ConstructorDescriptionIRCMessageEvent
(@NotNull String rawMessage, @NotNull Map<String, CharSequence> escapedTags, CharSequence clientName, @NotNull String commandType, @Nullable String channelName, @Nullable CharSequence payload, @Nullable String message, @NotNull Map<String, String> channelIdToChannelName, @NotNull Map<String, String> channelNameToChannelId, @Nullable Collection<String> botOwnerIds) IRCMessageEvent
(String rawMessage, Map<String, String> channelIdToChannelName, Map<String, String> channelNameToChannelId, Collection<String> botOwnerIds) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Get ChatChannelChannel IdMessage TypeTagsgetFlags()
AutoMod Message Flag Indicators, relevant for PRIVMSG and USERNOTICEThe message UUID that is used for deletion by a moderator or a chat reply (from Tags)getNonce()
RAW Message@Nullable CharSequence
Deprecated.in favor ofgetEscapedTags()
@Nullable String
getRawTagString
(@NotNull String name) getTags()
Deprecated.in favor ofgetTagValue(String)
orgetEscapedTags()
getTagValue
(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)int
hashCode()
isValid()
Deprecated.MessageParser.parse(String)
yields null for invalid messagesparseClientName
(String raw) Deprecated.This method is no longer used by twitch4jstatic Map<String,
CharSequence> Deprecated.This method is no longer used by twitch4jtoString()
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
-
Field Details
-
NONCE_TAG_NAME
- See Also:
-
-
Constructor Details
-
IRCMessageEvent
@Internal public IRCMessageEvent(@NotNull @NotNull String rawMessage, @NotNull @NotNull Map<String, CharSequence> escapedTags, CharSequence clientName, @NotNull @NotNull String commandType, @Nullable @Nullable String channelName, @Nullable @Nullable CharSequence payload, @Nullable @Nullable String message, @NotNull @NotNull Map<String, String> channelIdToChannelName, @NotNull @NotNull Map<String, String> channelNameToChannelId, @Nullable @Nullable Collection<String> botOwnerIds) -
IRCMessageEvent
@Deprecated public IRCMessageEvent(String rawMessage, Map<String, String> channelIdToChannelName, Map<String, String> channelNameToChannelId, Collection<String> botOwnerIds) Deprecated.UseMessageParser.parse(String, Map, Map, Collection)
to createIRCMessageEvent
instancesEvent 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
-
getBadgeInfo
- Returns:
- metadata related to the chat badges in the badges tag
-
getBadges
- Returns:
- the visible chat badges parsed from tags
-
getClientPermissions
- Returns:
- the permissions of the client that sent this message, based on visible badges
-
isValid
Deprecated.MessageParser.parse(String)
yields null for invalid messagesChecks if the Event was parsed correctly.- Returns:
- Is the Event valid?
-
parseTags
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") public static Map<String,CharSequence> parseTags(String raw) Deprecated.This method is no longer used by twitch4jParse Tags from raw list- Parameters:
raw
- The raw list of tags.- Returns:
- A key-value map of the tags.
-
parseClientName
@Deprecated @ScheduledForRemoval(inVersion="2.0.0") public static Optional<String> parseClientName(String raw) Deprecated.This method is no longer used by twitch4jGets 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
-
getUserDisplayName
- Returns:
- the display name of the user who sent this message, if applicable
-
getUserChatColor
- Returns:
- hexadecimal RGB color code of the user's chat color, or empty if it is never set.
-
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 or have the founders badge equipped
-
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
-
getChannelName
- Returns:
- the channel name associated with this event, if applicable
-
getPayload
- Returns:
- IRC message payload, which includes a colon prefix, unlike
getMessage()
-
getMessage
- Returns:
- the message sent by a user to an IRC channel
-
getClientName
- Returns:
- the client name associated with the message, excluding the hostname
-
getRawTag
- Parameters:
name
- the tag key- Returns:
- the (not escaped) tag value associated with the specified key, in
CharSequence
form
-
getRawTagString
- Parameters:
name
- the tag key- Returns:
- the (not escaped) tag value associated with the specified key, in
String
form
-
getTags
Deprecated.in favor ofgetTagValue(String)
orgetEscapedTags()
- Returns:
- raw (i.e., not unescaped) IRCv3 tags
-
getRawTags
Deprecated.in favor ofgetEscapedTags()
- Returns:
- IRCv3 tags
-
toString
- Overrides:
toString
in classTwitchEvent
-
getEscapedTags
TagsMost applications should utilize
getTagValue(String)
rather than accessing this map directly. -
getCommandType
Message Type -
getChannelId
Channel Id -
getRawMessage
RAW Message -
equals
- Overrides:
equals
in classTwitchEvent
-
canEqual
- Overrides:
canEqual
in classTwitchEvent
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTwitchEvent
-
getFlags
AutoMod Message Flag Indicators, relevant for PRIVMSG and USERNOTICE
-
MessageParser.parse(String, Map, Map, Collection)
to createIRCMessageEvent
instances