Package discord4j.core.object.entity
Class ScheduledEvent
java.lang.Object
discord4j.core.object.entity.ScheduledEvent
- All Implemented Interfaces:
DiscordObject
,Entity
A Discord Guild Scheduled Event
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents a scheduled event's entity typestatic enum
Represents a scheduled event's privacy level.static enum
Represents a scheduled event's status -
Constructor Summary
ConstructorDescriptionScheduledEvent
(GatewayDiscordClient gateway, discord4j.discordjson.json.GuildScheduledEventData data) Constructs aScheduledEvent
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptiondelete()
Requests to delete this event.Requests to delete this event with the provided reason.discord4j.core.spec.ScheduledEventEditMono
edit()
Requests to edit this scheduled eventedit
(discord4j.core.spec.ScheduledEventEditSpec spec) Requests to edit this scheduled event with the provided spec.Requests to retrieve the channel this event will be hosted in, if present.Gets the ID of the channel where the event will be hosted, if present.Returns theGatewayDiscordClient
that created this object.Requests to retrieve the creator if this event, if present.Gets the ID of the creator of the event.discord4j.discordjson.json.GuildScheduledEventData
getData()
Gets the data of the scheduled event.Return the description of this scheduled event.Gets the scheduled end time of the event, if present.Gets the ID of the entity this event will be hosted in, if present.Gets the entity metadata of the event, if present.Gets the entity type of the event.Gets the guild ID of the scheduled event.getId()
Gets the Snowflake that uniquely identifies this entity.getImageUrl
(Image.Format format) Returns the cover image URL of this scheduled event, if present.Gets the location of the event, if present.getName()
Return the name of this scheduled event.Gets the privacy level of the eventGets the scheduled start time of the event.Gets the status of the event.Gets the count of users who have subscribed to the event, if present.getSubscribedUsers
(boolean withMemberData) Requests to retrieve the users subscribed to this event.getSubscribedUsersAfter
(Snowflake userId, boolean withMemberData) Requests to retrieve the users subscribed to this event after the given user ID.getSubscribedUsersBefore
(Snowflake userId, boolean withMemberData) Requests to retrieve the users subscribed to this event before the given user ID.
-
Constructor Details
-
ScheduledEvent
public ScheduledEvent(GatewayDiscordClient gateway, discord4j.discordjson.json.GuildScheduledEventData data) Constructs aScheduledEvent
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getId
Description copied from interface:Entity
Gets the Snowflake that uniquely identifies this entity. -
getData
public discord4j.discordjson.json.GuildScheduledEventData getData()Gets the data of the scheduled event.- Returns:
- The data of the scheduled event.
-
getGuildId
Gets the guild ID of the scheduled event.- Returns:
- The guild ID of the scheduled event.
-
getCreatorId
Gets the ID of the creator of the event.- Returns:
- The ID of the creator of the event.
-
getCreator
Requests to retrieve the creator if this event, if present.- Returns:
- A
Mono
where, if the creator is present, emits thecreator
of the event, otherwise emits anempty mono
. If an error is received, it is emitted through theMono
.
-
getChannelId
Gets the ID of the channel where the event will be hosted, if present.- Returns:
- The ID of the channel where the event will be hosted, if present.
-
getChannel
Requests to retrieve the channel this event will be hosted in, if present.Note: This channel could be a stage or voice channel, see
getEntityType()
to determine the type safely.- Returns:
- A
Mono
where, if the channel is present, emits thechannel
this event will be hosted in, otherwise emits anempty mono
. If an error is received, it is emitted through theMono
.
-
getName
Return the name of this scheduled event.- Returns:
- the scheduled event name
-
getDescription
Return the description of this scheduled event.- Returns:
- the scheduled event description, if present
-
getStartTime
Gets the scheduled start time of the event.- Returns:
- The scheduled start time of the event.
-
getEndTime
Gets the scheduled end time of the event, if present.Note: Note: This metadata will always be present when the entity type is
external
.- Returns:
- The scheduled end time of the event, if present.
-
getPrivacyLevel
Gets the privacy level of the event- Returns:
- The privacy level of the event
-
getStatus
Gets the status of the event.- Returns:
- The status of the event.
-
getImageUrl
Returns the cover image URL of this scheduled event, if present.- Parameters:
format
- the format for the URL- Returns:
- the cover image URL, if present.
-
getEntityType
Gets the entity type of the event.- Returns:
- The entity type of the event.
-
getEntityId
Gets the ID of the entity this event will be hosted in, if present.Note: This property currently matches
getChannelId()
, it is believed this is available for future flexibility for Discord and should not be relied on.- Returns:
- The ID of the entity this event will be hosted in, if present.
-
getEntityMetadata
Gets the entity metadata of the event, if present.Note: This metadata will always be present when the entity type is
external
.- Returns:
- The entity metadata of the event, if present.
-
getLocation
Gets the location of the event, if present.Note: This location is pulled from
ScheduledEventEntityMetadata.getLocation()
if present.- Returns:
- The location of the event, if present.
-
getSubscribedUserCount
Gets the count of users who have subscribed to the event, if present.- Returns:
- The count of users who have subscribed to the event, if present.
-
getSubscribedUsers
Requests to retrieve the users subscribed to this event. -
getSubscribedUsersBefore
Requests to retrieve the users subscribed to this event- before
the given user ID. -
getSubscribedUsersAfter
Requests to retrieve the users subscribed to this event- after
the given user ID. -
edit
public discord4j.core.spec.ScheduledEventEditMono edit()Requests to edit this scheduled event -
edit
Requests to edit this scheduled event with the provided spec. -
delete
Requests to delete this event with the provided reason.- Parameters:
reason
- the reason explaining why this event is being deleted- Returns:
- A
Mono
which completes when the event is deleted.
-
delete
Requests to delete this event.- Returns:
- A
Mono
which completes when the event is deleted.
-