Class GenericScheduledEventUserEvent

All Implemented Interfaces:
GenericEvent
Direct Known Subclasses:
ScheduledEventUserAddEvent, ScheduledEventUserRemoveEvent

public abstract class GenericScheduledEventUserEvent extends GenericScheduledEventGatewayEvent
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 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 the ScheduledEvent.
      Returns:
      The long user id
    • getUserId

      @Nonnull public String getUserId()
      The id of the user that subscribed or unsubscribed to the ScheduledEvent.
      Returns:
      The string user id
    • getUser

      @Nullable public User getUser()
      The User who subscribed or unsubscribed to the ScheduledEvent.
      This might be missing if the user was not cached. Use retrieveUser() to load the user.
      Returns:
      The added user or null if this information is missing
    • getMember

      @Nullable public Member getMember()
      The Member instance for the user or null if the user is not in this guild.
      This will also be null if the member is not available in the cache. Use retrieveMember() to load the member.
      Returns:
      Member of the added user or null if they are no longer member of this guild
    • retrieveUser

      @Nonnull @CheckReturnValue public CacheRestAction<User> retrieveUser()
      Retrieves the User that subscribed or unsubscribed to the ScheduledEvent.
      If a user is known, this will return getUser().
      Returns:
      RestAction - Type: User
    • retrieveMember

      @Nonnull @CheckReturnValue public CacheRestAction<Member> retrieveMember()
      Retrieves the Member that subscribed or unsubscribed to the ScheduledEvent.
      If a member is known, this will return getMember().
      Returns:
      RestAction - Type: Member