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
ConstructorsConstructorDescriptionGenericScheduledEventUserEvent(JDA api, long responseNumber, ScheduledEvent scheduledEvent, long userId) -
Method Summary
Modifier and TypeMethodDescriptionTheMemberinstance for the user ornullif the user is not in this guild.getUser()TheUserwho subscribed or unsubscribed to theScheduledEvent.The id of the user that subscribed or unsubscribed to theScheduledEvent.longThe id of the user that subscribed or unsubscribed to theScheduledEvent.Retrieves theMemberthat subscribed or unsubscribed to theScheduledEvent.Retrieves theUserthat subscribed or unsubscribed to theScheduledEvent.Methods inherited from class net.dv8tion.jda.api.events.guild.scheduledevent.GenericScheduledEventGatewayEvent
getScheduledEventMethods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuildMethods 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
TheUserwho 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
TheMemberinstance for the user ornullif the user is not in this guild.
This will also benullif 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 theUserthat subscribed or unsubscribed to theScheduledEvent.
If a user is known, this will returngetUser().- Returns:
RestAction- Type:User
-
retrieveMember
Retrieves theMemberthat subscribed or unsubscribed to theScheduledEvent.
If a member is known, this will returngetMember().- Returns:
RestAction- Type:Member
-