Class SubscriptionEvent
java.lang.Object
com.github.philippheuer.events4j.core.domain.Event
com.github.twitch4j.chat.events.TwitchEvent
com.github.twitch4j.chat.events.AbstractChannelEvent
com.github.twitch4j.chat.events.channel.SubscriptionEvent
- All Implemented Interfaces:
com.github.philippheuer.events4j.api.domain.IEvent
,ReplyableEvent
This event gets called when a user gets a new subscriber or a user resubscribes.
This event will be called simultaneously with the chat announcement, not necessary when the user presses the subscription button.
-
Constructor Summary
ConstructorDescriptionSubscriptionEvent
(IRCMessageEvent event, EventChannel channel, EventUser user, String subPlan, Optional<String> message, Integer months, Boolean gifted, EventUser giftedBy, Integer subStreak, Integer giftMonths, Integer multiMonthDuration, Integer multiMonthTenure, List<AutoModFlag> flags) Event Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
getFlags()
The regions ofgetMessage()
that were flagged by AutoMod (Unofficial)Was this sub gifted?User that gifted the subThe number of months gifted as part of a single, multi-month giftSubscription MessageRaw IRC Message EventCumulative months subscribedThe number of subscription months just purchased.@Nullable Integer
The length of multi-month subscription tenure that has already been served.Subscription Plan, in enum formSubscription PlanDeprecated.will be removed in favor of .getSubPlan()Consecutive months subscribedgetUser()
Event Target Userint
hashCode()
void
reply
(ITwitchChat chat, String message) Replies to this sub event, if a message was included when the subscription was shared.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
Methods inherited from interface com.github.twitch4j.chat.events.channel.ReplyableEvent
getChannel
-
Constructor Details
-
SubscriptionEvent
public SubscriptionEvent(IRCMessageEvent event, EventChannel channel, EventUser user, String subPlan, Optional<String> message, Integer months, Boolean gifted, EventUser giftedBy, Integer subStreak, Integer giftMonths, Integer multiMonthDuration, Integer multiMonthTenure, List<AutoModFlag> flags) Event Constructor- Parameters:
event
- The raw message event.channel
- ChatChannel the user subscribed touser
- User that subscribedsubPlan
- Sub Planmessage
- Sub Messagemonths
- Cumulative number of months user has been subscribed (not consecutive)gifted
- Is gifted?giftedBy
- User that gifted the subsubStreak
- Consecutive number of months user has been subscribed (not cumulative); 0 if no streak or user chooses not to share their streakgiftMonths
- The number of months gifted as part of a single, multi-month giftmultiMonthDuration
- The number of subscription months just purchasedmultiMonthTenure
- The length of multi-month subscription tenure that has already been servedflags
- The regions of the message that were flagged by AutoMod.
-
-
Method Details
-
reply
Replies to this sub event, if a message was included when the subscription was shared.Sends a reply to this chat message.
- Specified by:
reply
in interfaceReplyableEvent
- Parameters:
chat
- theITwitchChat
instance to send the message from.message
- the message to be sent.
-
getSubscriptionPlanName
Deprecated.will be removed in favor of .getSubPlan()Gets the Subscription Plan- Returns:
- SubscriptionPlan
-
getMessageEvent
Raw IRC Message Event- Specified by:
getMessageEvent
in interfaceReplyableEvent
-
getUser
Event Target User -
getSubscriptionPlan
Subscription Plan -
getMessage
Subscription Message -
getMonths
Cumulative months subscribed -
getGifted
Was this sub gifted? -
getGiftedBy
User that gifted the sub -
getSubStreak
Consecutive months subscribed -
getGiftMonths
The number of months gifted as part of a single, multi-month gift -
getMultiMonthDuration
The number of subscription months just purchased. (Unofficial) -
getMultiMonthTenure
The length of multi-month subscription tenure that has already been served. Can be null for gifts. (Unofficial) -
getFlags
The regions ofgetMessage()
that were flagged by AutoMod (Unofficial) -
equals
- Overrides:
equals
in classAbstractChannelEvent
-
canEqual
- Overrides:
canEqual
in classAbstractChannelEvent
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractChannelEvent
-
toString
- Overrides:
toString
in classAbstractChannelEvent
-
getSubPlan
Subscription Plan, in enum form
-