Interface ScheduledEventAction
- All Superinterfaces:
AuditableRestAction<ScheduledEvent>
,FluentAuditableRestAction<ScheduledEvent,
,ScheduledEventAction> RestAction<ScheduledEvent>
public interface ScheduledEventAction
extends FluentAuditableRestAction<ScheduledEvent,ScheduledEventAction>
Extension of
RestAction
specifically
designed to create a ScheduledEvent
.
This extension allows setting properties such as the name or description of an event before it is
created.
Requirements
Events that are created are required to have a name, a location, and a start time. Depending on the
type of location provided, an event will be of one of three different Types
:
-
Type.STAGE_INSTANCE
These events are set to take place inside of aStageChannel
. The following permissions are required in the specified stage channel in order to create an event there: -
Type.VOICE
These events are set to take place inside of aVoiceChannel
. The following permissions are required in the specified voice channel in order to create an event there: -
Type.EXTERNAL
These events are set to take place at an external location.Permission.MANAGE_EVENTS
is required on the guild level in order to create this type of event. Additionally, an end time must also be specified.
-
Field Summary
Fields inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
MAX_REASON_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptiongetGuild()
The guild to create theScheduledEvent
insetDescription
(String description) Sets the description for the newScheduledEvent
.setEndTime
(TemporalAccessor endTime) Sets the time that the newScheduledEvent
will end at.Sets the cover image for the newScheduledEvent
.Sets the name for the newScheduledEvent
.setStartTime
(TemporalAccessor startTime) Sets the time that the newScheduledEvent
will start at.Methods inherited from interface net.dv8tion.jda.api.requests.restaction.FluentAuditableRestAction
addCheck, deadline, reason, setCheck, timeout
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
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
-
Method Details
-
getGuild
The guild to create theScheduledEvent
in- Returns:
- The guild
-
setName
Sets the name for the newScheduledEvent
.- Parameters:
name
- The name for the newScheduledEvent
- Returns:
- The current ScheduledEventAction, for chaining convenience
- Throws:
IllegalArgumentException
- If the new name is blank, empty,null
, or contains more than 100 characters
-
setDescription
Sets the description for the newScheduledEvent
. This field may include markdown.- Parameters:
description
- The description for the newScheduledEvent
, ornull
for no description- Returns:
- The current ScheduledEventAction, for chaining convenience
- Throws:
IllegalArgumentException
- If the new description is longer than 1000 characters
-
setStartTime
Sets the time that the new
ScheduledEvent
will start at. Events ofType.EXTERNAL
will automatically start at this time, but events ofType.STAGE_INSTANCE
andType.VOICE
will need to be manually started, and will automatically be cancelled a few hours after the start time if not.- Parameters:
startTime
- The time that the newScheduledEvent
should start at- Returns:
- The current ScheduledEventAction, for chaining convenience
- Throws:
IllegalArgumentException
- If the provided start time isnull
, or takes place after the end time
-
setEndTime
Sets the time that the newScheduledEvent
will 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 user has left the channel.Note: Setting an end time is only possible for events of
Type.EXTERNAL
.- Parameters:
endTime
- The time that the newScheduledEvent
is set to end at- Returns:
- The current ScheduledEventAction, for chaining convenience
- Throws:
IllegalArgumentException
- If the provided end time is chronologically set before the start time
-
setImage
Sets the cover image for the newScheduledEvent
.- Parameters:
icon
- The cover image for the newScheduledEvent
, ornull
for no cover image- Returns:
- The current ScheduledEventAction, for chaining convenience
-