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
Modifier and TypeFieldDescriptionstatic final long
Used to reset the description fieldstatic final long
Used to reset the end time fieldstatic final long
Used to reset the image fieldstatic final long
Used to reset the location fieldstatic final long
Used to reset the name fieldstatic final long
Used to reset the start time fieldstatic final long
Used to reset the status fieldFields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptiondefault Guild
getGuild()
TheGuild
thisScheduledEvent
is in.The targetScheduledEvent
for 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 selectedScheduledEvent
should end at.Sets the cover image for the newScheduledEvent
.setLocation
(String location) Sets the location of the selectedScheduledEvent
to take place externally, or not in a specificGuildChannel
.setLocation
(GuildChannel channel) Sets the location of the selectedScheduledEvent
to take place in the specifiedGuildChannel
.Sets the name of the selectedScheduledEvent
setStartTime
(TemporalAccessor startTime) Sets the time that the selectedScheduledEvent
should start at.setStatus
(ScheduledEvent.Status status) Sets the status of the event.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
Methods 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:
reset
in 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:
reset
in interfaceManager<ScheduledEventManager>
- Parameters:
fields
- Integer values containing the flags to reset.- Returns:
- ScheduledEventManager for chaining convenience
-
getScheduledEvent
The targetScheduledEvent
for this manager -
getGuild
TheGuild
thisScheduledEvent
is 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
, ornull
to 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
, ornull
for no cover image.- Returns:
- ScheduledEventManager for chaining convenience
-
setLocation
Sets the location of the selectedScheduledEvent
to take place in the specifiedGuildChannel
.This will change the event's type to
ScheduledEvent.Type.STAGE_INSTANCE
orScheduledEvent.Type.VOICE
, which are the only supported channel types for the location of scheduled events currently.- Parameters:
channel
- TheGuildChannel
that the selectedScheduledEvent
is set to take place in.- Returns:
- ScheduledEventManager for chaining convenience
- Throws:
IllegalArgumentException
-- If the provided
GuildChannel
isnull
- If the provided
GuildChannel
is not from the same guild - If the provided
GuildChannel
is not aStageChannel
orVoiceChannel
- 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 selectedScheduledEvent
to 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 selectedScheduledEvent
is 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 selectedScheduledEvent
does not have an end timeInsufficientPermissionException
- If the currently logged in account does not havePermission.MANAGE_EVENTS
- See Also:
-
setStartTime
Sets the time that the selectedScheduledEvent
should start at. Events ofType.EXTERNAL
will automatically start at this time. Events ofType.STAGE_INSTANCE
andType.VOICE
need to be manually started. If theScheduledEvent
has not begun after its scheduled start time, it will be automatically cancelled after a few hours.- Parameters:
startTime
- The time that the selectedScheduledEvent
is 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 selectedScheduledEvent
should end at. Events ofType.EXTERNAL
will automatically end at this time, and events ofType.STAGE_INSTANCE
andType.VOICE
will end a few minutes after the last person has left the channel.- Parameters:
endTime
- The time that the selectedScheduledEvent
is 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:
-