Interface ScheduledEvent

All Superinterfaces:
Comparable<ScheduledEvent>, ISnowflake

public interface ScheduledEvent extends ISnowflake, Comparable<ScheduledEvent>
A class representing a ScheduledEvent (The events that show up under the events tab in the Official Discord Client). These events should not be confused with Gateway Events, which are fired by Discord whenever something interesting happens (ie., a MessageDeleteEvent gets fired whenever a message gets deleted).
  • Field Details

  • Method Details

    • getName

      @Nonnull String getName()
      The name of the event.
      Returns:
      The event's name
    • getDescription

      @Nullable String getDescription()
      The description of the event.
      Returns:
      The description, or null if none is specified
    • getImageUrl

      @Nullable String getImageUrl()
      The cover image url of the event.

      Links to a potentially heavily compressed image. You can append a size parameter to the URL if needed. Example: ?size=4096

      Returns:
      The image url, or null if none is specified
    • getImage

      @Nullable default ImageProxy getImage()
      Returns an ImageProxy for this events cover image.
      Returns:
      The ImageProxy for this events cover image or null if no image is defined
      See Also:
    • getCreator

      @Nullable User getCreator()
      The user who originally created the event.

      May return null if user has deleted their account, the User object is not cached or the event was created before Discord started keeping track of event creators on October 21st, 2021.

      Returns:
      User object representing the event's creator or null.
      See Also:
    • getCreatorIdLong

      long getCreatorIdLong()
      The ID of the user who originally created this event.

      This method may return 0 if the event was created before Discord started keeping track of event creators on October 21st, 2021.

      Returns:
      The ID of the user who created this event, or 0 if no user is associated with creating this event.
      See Also:
    • getCreatorId

      @Nullable default String getCreatorId()
      The ID of the user who originally created this event.
      This method may return null if the event was created before Discord started keeping track of event creators on October 21st, 2021.
      Returns:
      The Id of the user who created this event, or null if no user is associated with creating this event.
      See Also:
    • getStatus

      @Nonnull ScheduledEvent.Status getStatus()
      The status of the scheduled event.
      Returns:
      The status, or ScheduledEvent.Status.UNKNOWN if the status is unknown to JDA.
    • getType

      @Nonnull ScheduledEvent.Type getType()
      The type of the scheduled event.
      Returns:
      The type, or ScheduledEvent.Type.UNKNOWN if the type is unknown to JDA.
    • getStartTime

      @Nonnull OffsetDateTime getStartTime()
      The time the event is set to start at.
      Returns:
      The time the event is set to start at
      See Also:
    • getEndTime

      @Nullable OffsetDateTime getEndTime()
      The time the event is set to end at.
      The end time is only required for external events, which are events that are not associated with a stage or voice channel.
      Returns:
      The time the event is set to end at. This can't be null for events of ScheduledEvent.Type.EXTERNAL, but can be null for other types.
      See Also:
    • getChannel

      @Nullable GuildChannelUnion getChannel()
      The guild channel the event is set to take place in.
      Note that this method is only applicable to events which are not of ScheduledEvent.Type.STAGE_INSTANCE or ScheduledEvent.Type.VOICE.
      Returns:
      The guild channel, or null if the guild channel was deleted or if the event is of ScheduledEvent.Type.EXTERNAL
      See Also:
    • getLocation

      @Nonnull String getLocation()
      The location the event is set to take place in. This will return the channel id for ScheduledEvent.Type.STAGE_INSTANCE and ScheduledEvent.Type.VOICE.
      Returns:
      The channel id or the external location of the event
      See Also:
    • getJumpUrl

      @Nonnull String getJumpUrl()
      Returns the jump-to URL of the event. Clicking this URL in the Discord client will open the event.
      Returns:
      A String representing the jump-to URL of the event.
    • delete

      @Nonnull @CheckReturnValue AuditableRestAction<Void> delete()
      Deletes this Scheduled Event.

      Possible ErrorResponses include:

      Returns:
      AuditableRestAction
      Throws:
      InsufficientPermissionException - If we don't have the permission to MANAGE_EVENTS
    • retrieveInterestedMembers

      @Nonnull @CheckReturnValue ScheduledEventMembersPaginationAction retrieveInterestedMembers()
      A PaginationAction implementation that allows to iterate over all Members interested in this Event.
      This iterates in ascending order by member id.

      Possible ErrorResponses include:

      Returns:
      ScheduledEventMembersPaginationAction
    • getInterestedUserCount

      int getInterestedUserCount()
      The amount of users who are interested in attending the event.

      This method only returns the cached count, and may not be consistent with the live count. Discord may additionally not provide an interested user count for some ScheduledEvent objects returned from the Guild's or JDA's cache, and this method may return -1 as a result. However, event's retrieved using Guild.retrieveScheduledEventById(long) will always contain an interested user count.

      Returns:
      The amount of users who are interested in attending the event
      See Also:
    • getGuild

      @Nonnull Guild getGuild()
      The guild that this event was created in
      Returns:
      The guild
    • getJDA

      @Nonnull default JDA getJDA()
      The JDA instance associated with this event object
      Returns:
      The JDA instance
    • getManager

      @Nonnull @CheckReturnValue ScheduledEventManager getManager()
      The ScheduledEventManager for this event.
      In the ScheduledEventManager, you can modify all values and also start, end, or cancel events.
      You can modify multiple fields in one request by chaining setters before calling RestAction.queue().
      Returns:
      The ScheduledEventManager of this event
      Throws:
      InsufficientPermissionException - If the currently logged in account does not have Permission.MANAGE_EVENTS
    • compareTo

      int compareTo(@Nonnull ScheduledEvent scheduledEvent)
      Compares two ScheduledEvent objects based on their scheduled start times.
      If two events are set to start at the same time, the comparison will be made based on their snowflake ID.
      Specified by:
      compareTo in interface Comparable<ScheduledEvent>
      Parameters:
      scheduledEvent - The provided scheduled event
      Returns:
      A negative number if the original event (which is the event that the compareTo method is called upon) starts sooner than the provided event, or positive if it will start later than the provided event. If both events are set to start at the same time, then the result will be negative if the original event's snowflake ID is less than the provided event's ID, positive if it is greater than, or 0 if they are the same.
      Throws:
      IllegalArgumentException - If the provided scheduled event is null, from a different Guild, or is not a valid scheduled event provided by JDA.
      See Also: