Class Invite

    • Constructor Detail

      • Invite

        public Invite​(GatewayDiscordClient gateway,
                      discord4j.discordjson.json.InviteData data)
        Constructs a Invite 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

      • getCode

        public final String getCode()
        Gets the invite code (unique ID).
        Returns:
        The invite code (unique ID).
      • getGuildId

        public final Optional<Snowflake> getGuildId()
        Gets the ID of the guild this invite is associated to.
        Returns:
        The ID of the guild this invite is associated to.
      • getGuild

        public final Mono<Guild> getGuild()
        Requests to retrieve the guild this invite is associated to, if present.
        Returns:
        A Mono where, upon successful completion, emits the guild this invite is associated to. If an error is received, it is emitted through the Mono.
      • getGuild

        public final Mono<Guild> getGuild​(EntityRetrievalStrategy retrievalStrategy)
        Requests to retrieve the guild this invite is associated to, if present, using the given retrieval strategy.
        Parameters:
        retrievalStrategy - the strategy to use to get the guild
        Returns:
        A Mono where, upon successful completion, emits the guild this invite is associated to. If an error is received, it is emitted through the Mono.
      • getChannelId

        public final Snowflake getChannelId()
        Gets the ID of the channel this invite is associated to.
        Returns:
        The ID of the channel this invite is associated to.
      • getChannel

        public final Mono<CategorizableChannel> getChannel()
        Requests to retrieve the channel this invite is associated to.
        Returns:
        A Mono where, upon successful completion, emits the channel this invite is associated to. If an error is received, it is emitted through the Mono.
      • getChannel

        public final Mono<CategorizableChannel> getChannel​(EntityRetrievalStrategy retrievalStrategy)
        Requests to retrieve the channel this invite is associated to, using the given retrieval strategy.
        Parameters:
        retrievalStrategy - the strategy to use to get the channel
        Returns:
        A Mono where, upon successful completion, emits the channel this invite is associated to. If an error is received, it is emitted through the Mono.
      • getInviterId

        public final Optional<Snowflake> getInviterId()
        Gets the ID of the user who created the invite, if present.
        Returns:
        The ID of the user who created the invite, if present.
      • getInviter

        @Deprecated
        public final Mono<User> getInviter()
        Deprecated.
        this method will return Optional in v3.2.0, as the inviter User can be accessed directly. see this pull request for details
        Requests to retrieve the user who created the invite.
        Returns:
        A Mono where, upon successful completion, emits the user who created the invite. If an error is received, it is emitted through the Mono.
      • getInviter

        @Deprecated
        public final Mono<User> getInviter​(EntityRetrievalStrategy retrievalStrategy)
        Deprecated.
        this method will be removed in v3.2.0, as the inviter User can be accessed directly. see this pull request for details
        Requests to retrieve the user who created the invite, using the given retrieval strategy.
        Parameters:
        retrievalStrategy - the strategy to use to get the inviter
        Returns:
        A Mono where, upon successful completion, emits the user who created the invite. If an error is received, it is emitted through the Mono.
      • getTargetUserId

        public final Optional<Snowflake> getTargetUserId()
        Gets the ID of the target user this invite is associated to, if present.
        Returns:
        The ID of the target user this invite is associated to, if present.
      • getTargetUser

        @Deprecated
        public final Mono<User> getTargetUser()
        Deprecated.
        this method will return Optional in v3.2.0, as the inviter User can be accessed directly. see this pull request for details
        Requests to retrieve the target user this invite is associated to.
        Returns:
        A Mono where, upon successful completion, emits the target user this invite is associated to. If an error is received, it is emitted through the Mono.
      • getTargetUser

        @Deprecated
        public final Mono<User> getTargetUser​(EntityRetrievalStrategy retrievalStrategy)
        Deprecated.
        this method will be removed in v3.2.0, as the inviter User can be accessed directly. see this pull request for details
        Requests to retrieve the target user this invite is associated to, using the given retrieval strategy.
        Parameters:
        retrievalStrategy - the strategy to use to get the target user
        Returns:
        A Mono where, upon successful completion, emits the target user this invite is associated to. If an error is received, it is emitted through the Mono.
      • getTargetUserType

        @Deprecated
        public final Optional<Invite.Type> getTargetUserType()
        Deprecated.
        Gets the type of target user for this invite, if present.
        Returns:
        The type of target user for this invite, if present.
      • getTargetType

        public final Optional<Invite.Type> getTargetType()
        Gets the type of target for this voice channel invite, if present.
        Returns:
        The type of target for this voice channel invite, if present.
      • getApproximatePresenceCount

        public final OptionalInt getApproximatePresenceCount()
        Gets an approximate count of online members, returned from the Routes.INVITE_GET endpoint when with_counts is true.
        Returns:
        An approximate count of online members, returned from the Routes.INVITE_GET endpoint when with_counts is true.
      • getApproximateMemberCount

        public final OptionalInt getApproximateMemberCount()
        Gets an approximate count of total members, returned from the Routes.INVITE_GET endpoint when with_counts is true.
        Returns:
        An approximate count of total members, returned from the Routes.INVITE_GET endpoint when with_counts is true.
      • delete

        public final Mono<Void> delete()
        Requests to delete this invite.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the invite has been deleted. If an error is received, it is emitted through the Mono.
      • delete

        public final Mono<Void> delete​(@Nullable
                                       String reason)
        Requests to delete this invite while optionally specifying a reason.
        Parameters:
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the invite has been deleted. If an error is received, it is emitted through the Mono.