Class ScheduledEventImpl
- All Implemented Interfaces:
Comparable<ScheduledEvent>
,ISnowflake
,ScheduledEvent
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.entities.ScheduledEvent
ScheduledEvent.Status, ScheduledEvent.Type
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.ScheduledEvent
IMAGE_URL, JUMP_URL, MAX_DESCRIPTION_LENGTH, MAX_LOCATION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ScheduledEvent scheduledEvent) Compares twoScheduledEvent
objects based on their scheduled start times.delete()
Deletes this Scheduled Event.boolean
The guild channel the event is set to take place in.The user who originally created the event.long
The ID of the user who originally created this event.The description of the event.The time the event is set to end at.getGuild()
The guild that this event was created inlong
The Snowflake id of this entity.The cover image url of the event.int
The amount of users who are interested in attending the event.Returns the jump-to URL of the event.The location the event is set to take place in.TheScheduledEventManager
for this event.getName()
The name of the event.The time the event is set to start at.Thestatus
of the scheduled event.getType()
Thetype
of the scheduled event.int
hashCode()
setCreator
(User creator) setCreatorId
(long creatorId) setDescription
(String description) setEndTime
(OffsetDateTime endTime) setInterestedUserCount
(int interestedUserCount) setLocation
(String location) setStartTime
(OffsetDateTime startTime) setStatus
(ScheduledEvent.Status status) setType
(ScheduledEvent.Type type) toString()
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
Methods inherited from interface net.dv8tion.jda.api.entities.ScheduledEvent
getCreatorId, getImage, getJDA
-
Constructor Details
-
ScheduledEventImpl
-
-
Method Details
-
getName
Description copied from interface:ScheduledEvent
The name of the event.- Specified by:
getName
in interfaceScheduledEvent
- Returns:
- The event's name
-
getDescription
Description copied from interface:ScheduledEvent
The description of the event.- Specified by:
getDescription
in interfaceScheduledEvent
- Returns:
- The description, or
null
if none is specified
-
getImageUrl
Description copied from interface:ScheduledEvent
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
- Specified by:
getImageUrl
in interfaceScheduledEvent
- Returns:
- The image url, or
null
if none is specified
-
getCreator
Description copied from interface:ScheduledEvent
The user who originally created the event.May return
null
if user has deleted their account, theUser
object is not cached or the event was created before Discord started keeping track of event creators on October 21st, 2021.- Specified by:
getCreator
in interfaceScheduledEvent
- Returns:
User
object representing the event's creator ornull
.- See Also:
-
getCreatorIdLong
public long getCreatorIdLong()Description copied from interface:ScheduledEvent
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.
- Specified by:
getCreatorIdLong
in interfaceScheduledEvent
- Returns:
- The ID of the user who created this event, or 0 if no user is associated with creating this event.
- See Also:
-
getStatus
Description copied from interface:ScheduledEvent
Thestatus
of the scheduled event.- Specified by:
getStatus
in interfaceScheduledEvent
- Returns:
- The status, or
ScheduledEvent.Status.UNKNOWN
if the status is unknown to JDA.
-
getType
Description copied from interface:ScheduledEvent
Thetype
of the scheduled event.- Specified by:
getType
in interfaceScheduledEvent
- Returns:
- The type, or
ScheduledEvent.Type.UNKNOWN
if the type is unknown to JDA.
-
getStartTime
Description copied from interface:ScheduledEvent
The time the event is set to start at.- Specified by:
getStartTime
in interfaceScheduledEvent
- Returns:
- The time the event is set to start at
- See Also:
-
getEndTime
Description copied from interface:ScheduledEvent
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.- Specified by:
getEndTime
in interfaceScheduledEvent
- Returns:
- The time the event is set to end at. This can't be
null
for events ofScheduledEvent.Type.EXTERNAL
, but can be null for other types. - See Also:
-
getChannel
Description copied from interface:ScheduledEvent
The guild channel the event is set to take place in.
Note that this method is only applicable to events which are not ofScheduledEvent.Type.STAGE_INSTANCE
orScheduledEvent.Type.VOICE
.- Specified by:
getChannel
in interfaceScheduledEvent
- Returns:
- The guild channel, or
null
if the guild channel was deleted or if the event is ofScheduledEvent.Type.EXTERNAL
- See Also:
-
getLocation
Description copied from interface:ScheduledEvent
The location the event is set to take place in. This will return the channel id forScheduledEvent.Type.STAGE_INSTANCE
andScheduledEvent.Type.VOICE
.- Specified by:
getLocation
in interfaceScheduledEvent
- Returns:
- The channel id or the external location of the event
- See Also:
-
getJumpUrl
Description copied from interface:ScheduledEvent
Returns the jump-to URL of the event. Clicking this URL in the Discord client will open the event.- Specified by:
getJumpUrl
in interfaceScheduledEvent
- Returns:
- A String representing the jump-to URL of the event.
-
getInterestedUserCount
public int getInterestedUserCount()Description copied from interface:ScheduledEvent
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 usingGuild.retrieveScheduledEventById(long)
will always contain an interested user count.- Specified by:
getInterestedUserCount
in interfaceScheduledEvent
- Returns:
- The amount of users who are interested in attending the event
- See Also:
-
getGuild
Description copied from interface:ScheduledEvent
The guild that this event was created in- Specified by:
getGuild
in interfaceScheduledEvent
- Returns:
- The guild
-
getIdLong
public long getIdLong()Description copied from interface:ISnowflake
The Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLong
in interfaceISnowflake
- Returns:
- Long containing the Id.
-
getManager
Description copied from interface:ScheduledEvent
TheScheduledEventManager
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 callingRestAction.queue()
.- Specified by:
getManager
in interfaceScheduledEvent
- Returns:
- The ScheduledEventManager of this event
-
delete
Description copied from interface:ScheduledEvent
Deletes this Scheduled Event.Possible ErrorResponses include:
UNKNOWN_SCHEDULED_EVENT
If the the event was already deleted.MISSING_PERMISSIONS
The send request was attempted after the account lostPermission.MANAGE_EVENTS
in the guild.MISSING_ACCESS
If we were removed from the Guild
- Specified by:
delete
in interfaceScheduledEvent
- Returns:
AuditableRestAction
-
retrieveInterestedMembers
Description copied from interface:ScheduledEvent
APaginationAction
implementation that allows toiterate
over allMembers
interested in this Event.
This iterates in ascending order by member id.Possible ErrorResponses include:
ErrorResponse.UNKNOWN_SCHEDULED_EVENT
If the the event was already deleted.MISSING_ACCESS
If we were removed from the Guild or can't view the events channel (Location)
- Specified by:
retrieveInterestedMembers
in interfaceScheduledEvent
- Returns:
ScheduledEventMembersPaginationAction
-
setName
-
setType
-
setLocation
-
setDescription
-
setImage
-
setCreatorId
-
setCreator
-
setStatus
-
setStartTime
-
setEndTime
-
setInterestedUserCount
-
compareTo
Description copied from interface:ScheduledEvent
Compares twoScheduledEvent
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 interfaceComparable<ScheduledEvent>
- Specified by:
compareTo
in interfaceScheduledEvent
- 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. - See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-