Class ScheduledEvent

    • Constructor Detail

      • ScheduledEvent

        public ScheduledEvent​(GatewayDiscordClient gateway,
                              discord4j.discordjson.json.GuildScheduledEventData data)
        Constructs a ScheduledEvent with an associated GatewayDiscordClient and Discord data.
        Parameters:
        gateway - The GatewayDiscordClient associated to this object, must be non-null.
        data - The raw data as represented by Discord, must be non-null.
    • Method Detail

      • getId

        public Snowflake getId()
        Description copied from interface: Entity
        Gets the Snowflake that uniquely identifies this entity.
        Specified by:
        getId in interface Entity
        Returns:
        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

        public Snowflake getGuildId()
        Gets the guild ID of the scheduled event.
        Returns:
        The guild ID of the scheduled event.
      • getCreatorId

        public Optional<Snowflake> getCreatorId()
        Gets the ID of the creator of the event.
        Returns:
        The ID of the creator of the event.
      • getCreator

        public Mono<Member> getCreator()
        Requests to retrieve the creator if this event, if present.
        Returns:
        A Mono where, if the creator is present, emits the creator of the event, otherwise emits an empty mono. If an error is received, it is emitted through the Mono.
      • getChannelId

        public Optional<Snowflake> 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

        public Mono<GuildChannel> 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 the channel this event will be hosted in, otherwise emits an empty mono. If an error is received, it is emitted through the Mono.
      • getStartTime

        public Instant getStartTime()
        Gets the scheduled start time of the event.
        Returns:
        The scheduled start time of the event.
      • getEndTime

        public Optional<Instant> 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

        public ScheduledEvent.PrivacyLevel getPrivacyLevel()
        Gets the privacy level of the event
        Returns:
        The privacy level of the event
      • getStatus

        public ScheduledEvent.Status getStatus()
        Gets the status of the event.
        Returns:
        The status of the event.
      • getEntityType

        public ScheduledEvent.EntityType getEntityType()
        Gets the entity type of the event.
        Returns:
        The entity type of the event.
      • getEntityId

        public Optional<Snowflake> 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

        public Optional<ScheduledEventEntityMetadata> 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.
      • getSubscribedUserCount

        public Optional<Integer> 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

        public Flux<ScheduledEventUser> getSubscribedUsers​(boolean withMemberData)
        Requests to retrieve the users subscribed to this event.
        Parameters:
        withMemberData - requests to return member data along with user data
        Returns:
        A Flux that continually emits all users after the specified ID. If an error is received, it is emitted through the Flux.
      • getSubscribedUsersBefore

        public Flux<ScheduledEventUser> getSubscribedUsersBefore​(Snowflake userId,
                                                                 boolean withMemberData)
        Requests to retrieve the users subscribed to this event
      • before
      • the given user ID.
Parameters:
userId - the ID of the
  • newest
  • user to retrieve
    withMemberData - requests to return member data along with user data
    Returns:
    A Flux that continually emits all users after the specified ID. If an error is received, it is emitted through the Flux.
    Parameters:
    userId - the ID of the
  • oldest
  • user to retrieve
    withMemberData - requests to return member data along with user data
    Returns:
    A Flux that continually emits all users after the specified ID. If an error is received, it is emitted through the Flux.