Package net.dv8tion.jda.api.managers
Interface ScheduledEventManager
- All Superinterfaces:
AuditableRestAction<Void>,Manager<ScheduledEventManager>,RestAction<Void>
The Manager is providing functionality to update one or more fields of a
The manager may also be used to start, cancel or end events.
ScheduledEvent.
The manager may also be used to start, cancel or end events.
Example
manager.setLocation("at the beach")
.setStartTime(OffsetDateTime.now().plusHours(1))
.setEndTime(OffsetDateTime.now().plusHours(3))
.setName("Discussing Turtle Shells")
.queue();
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longUsed to reset the description fieldstatic final longUsed to reset the end time fieldstatic final longUsed to reset the image fieldstatic final longUsed to reset the location fieldstatic final longUsed to reset the name fieldstatic final longUsed to reset the start time fieldstatic final longUsed to reset the status fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH -
Method Summary
Modifier and TypeMethodDescriptiondefault GuildgetGuild()TheGuildthisScheduledEventis in.The targetScheduledEventfor this managerreset(long fields) Resets the fields specified by the provided bit-flag pattern.reset(long... fields) Resets the fields specified by the provided bit-flag patterns.setDescription(String description) Sets the description of the selectedScheduledEvent.setEndTime(TemporalAccessor endTime) Sets the time that the selectedScheduledEventshould end at.Sets the cover image for the newScheduledEvent.setLocation(String location) Sets the location of the selectedScheduledEventto take place externally, or not in a specificGuildChannel.setLocation(GuildChannel channel) Sets the location of the selectedScheduledEventto take place in the specifiedGuildChannel.Sets the name of the selectedScheduledEventsetStartTime(TemporalAccessor startTime) Sets the time that the selectedScheduledEventshould start at.setStatus(ScheduledEvent.Status status) Sets the status of the event.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reasonMethods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeoutMethods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Field Details
-
NAME
static final long NAMEUsed to reset the name field- See Also:
-
DESCRIPTION
static final long DESCRIPTIONUsed to reset the description field- See Also:
-
LOCATION
static final long LOCATIONUsed to reset the location field- See Also:
-
START_TIME
static final long START_TIMEUsed to reset the start time field- See Also:
-
END_TIME
static final long END_TIMEUsed to reset the end time field- See Also:
-
IMAGE
static final long IMAGEUsed to reset the image field- See Also:
-
STATUS
static final long STATUSUsed to reset the status field- See Also:
-
-
Method Details
-
reset
Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(ScheduledEventManager.DESCRIPTION | ScheduledEventManager.END_TIME);Flag Constants:
- Specified by:
resetin interfaceManager<ScheduledEventManager>- Parameters:
fields- Integer value containing the flags to reset.- Returns:
- ScheduledEventManager for chaining convenience
-
reset
Resets the fields specified by the provided bit-flag patterns. You can specify a combination by using a bitwise OR concat of the flag constants.
Example:manager.reset(ScheduledEventManager.DESCRIPTION, ScheduledEventManager.END_TIME);Flag Constants:
- Specified by:
resetin interfaceManager<ScheduledEventManager>- Parameters:
fields- Integer values containing the flags to reset.- Returns:
- ScheduledEventManager for chaining convenience
-
getScheduledEvent
The targetScheduledEventfor this manager -
getGuild
TheGuildthisScheduledEventis in.
This is logically the same as callinggetScheduledEvent().getGuild()- Returns:
- The parent
Guild
-
setName
Sets the name of the selectedScheduledEvent- Parameters:
name- The new name for the selectedScheduledEvent- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException- If the new name is blank, empty,null, or longer than 100 characters
-
setDescription
Sets the description of the selectedScheduledEvent. This field may include markdown.- Parameters:
description- The new description for the selectedScheduledEvent, ornullto reset the description- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException- If the new description is longer than 1000 characters
-
setImage
Sets the cover image for the newScheduledEvent.- Parameters:
icon- The cover image for the newScheduledEvent, ornullfor no cover image.- Returns:
- ScheduledEventManager for chaining convenience
-
setLocation
Sets the location of the selectedScheduledEventto take place in the specifiedGuildChannel.This will change the event's type to
ScheduledEvent.Type.STAGE_INSTANCEorScheduledEvent.Type.VOICE, which are the only supported channel types for the location of scheduled events currently.- Parameters:
channel- TheGuildChannelthat the selectedScheduledEventis set to take place in.- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException-- If the provided
GuildChannelisnull - If the provided
GuildChannelis not from the same guild - If the provided
GuildChannelis not aStageChannelorVoiceChannel
- If the provided
InsufficientPermissionException- If the currently logged in account does not havePermission.MANAGE_EVENTS,Permission.MANAGE_CHANNEL,Permission.VOICE_MUTE_OTHERS, orPermission.VOICE_MOVE_OTHERS, in the provided channel.
-
setLocation
Sets the location of the selectedScheduledEventto take place externally, or not in a specificGuildChannel. Please note that an event is required to have an end time set if the location is external.This will change the event's type to
ScheduledEvent.Type.EXTERNAL- Parameters:
location- The location that the selectedScheduledEventis set to take place at.- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided location is blank, empty,null, or longer than 100IllegalStateException- If the selectedScheduledEventdoes not have an end timeInsufficientPermissionException- If the currently logged in account does not havePermission.MANAGE_EVENTS- See Also:
-
setStartTime
Sets the time that the selectedScheduledEventshould start at. Events ofType.EXTERNALwill automatically start at this time. Events ofType.STAGE_INSTANCEandType.VOICEneed to be manually started. If theScheduledEventhas not begun after its scheduled start time, it will be automatically cancelled after a few hours.- Parameters:
startTime- The time that the selectedScheduledEventis set to start at.- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException-- If the provided start time is
null - If the provided start time is before the end time
- If the provided start time is before the current time
- If the provided start time is
- See Also:
-
setEndTime
Sets the time that the selectedScheduledEventshould end at. Events ofType.EXTERNALwill automatically end at this time, and events ofType.STAGE_INSTANCEandType.VOICEwill end a few minutes after the last person has left the channel.- Parameters:
endTime- The time that the selectedScheduledEventis set to end at.- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException-- If the provided end time is before the start time
- If the provided end time is
null
- See Also:
-
setStatus
Sets the status of the event. This method may be used to start, end or cancel an event but can only be used to complete one of the following transitions:- Parameters:
status- The new status- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalStateException- If the transition between statuses does not follow one of the three documented above.IllegalArgumentException- If the provided status isnull- See Also:
-