Class GenericScheduledEventUserEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.guild.GenericGuildEvent
net.dv8tion.jda.api.events.guild.scheduledevent.GenericScheduledEventGatewayEvent
net.dv8tion.jda.api.events.guild.scheduledevent.GenericScheduledEventUserEvent
- All Implemented Interfaces:
GenericEvent
- Direct Known Subclasses:
ScheduledEventUserAddEvent
,ScheduledEventUserRemoveEvent
Indicates that a
User
has subscribed or unsubscribed to a ScheduledEvent
.
Can be used to detect when someone has indicated that they have subscribed or unsubscribed to an event and also retrieve their
User
object as well as the ScheduledEvent
.
Requirements
This event requires the SCHEDULED_EVENTS
intent and CacheFlag.SCHEDULED_EVENTS
to be enabled.
createDefault(String)
and
createLight(String)
disable this by default!
-
Constructor Summary
ConstructorDescriptionGenericScheduledEventUserEvent
(JDA api, long responseNumber, ScheduledEvent scheduledEvent, long userId) -
Method Summary
Modifier and TypeMethodDescriptionTheMember
instance for the user ornull
if the user is not in this guild.getUser()
TheUser
who subscribed or unsubscribed to theScheduledEvent
.The id of the user that subscribed or unsubscribed to theScheduledEvent
.long
The id of the user that subscribed or unsubscribed to theScheduledEvent
.Retrieves theMember
that subscribed or unsubscribed to theScheduledEvent
.Retrieves theUser
that subscribed or unsubscribed to theScheduledEvent
.Methods inherited from class net.dv8tion.jda.api.events.guild.scheduledevent.GenericScheduledEventGatewayEvent
getScheduledEvent
Methods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuild
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumber, toString
-
Constructor Details
-
GenericScheduledEventUserEvent
public GenericScheduledEventUserEvent(@Nonnull JDA api, long responseNumber, @Nonnull ScheduledEvent scheduledEvent, long userId)
-
-
Method Details
-
getUserIdLong
public long getUserIdLong()The id of the user that subscribed or unsubscribed to theScheduledEvent
.- Returns:
- The long user id
-
getUserId
The id of the user that subscribed or unsubscribed to theScheduledEvent
.- Returns:
- The string user id
-
getUser
TheUser
who subscribed or unsubscribed to theScheduledEvent
.
This might be missing if the user was not cached. UseretrieveUser()
to load the user.- Returns:
- The added user or null if this information is missing
-
getMember
TheMember
instance for the user ornull
if the user is not in this guild.
This will also benull
if the member is not available in the cache. UseretrieveMember()
to load the member.- Returns:
- Member of the added user or null if they are no longer member of this guild
-
retrieveUser
Retrieves theUser
that subscribed or unsubscribed to theScheduledEvent
.
If a user is known, this will returngetUser()
.- Returns:
RestAction
- Type:User
-
retrieveMember
Retrieves theMember
that subscribed or unsubscribed to theScheduledEvent
.
If a member is known, this will returngetMember()
.- Returns:
RestAction
- Type:Member
-