Package discord4j.core.object
Class Invite
java.lang.Object
discord4j.core.object.Invite
- All Implemented Interfaces:
DiscordObject
- Direct Known Subclasses:
ExtendedInvite
A Discord invite.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the various types of target user for an invite. -
Constructor Summary
ConstructorDescriptionInvite
(GatewayDiscordClient gateway, discord4j.discordjson.json.InviteData data) Constructs aInvite
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptiondelete()
Requests to delete this invite.Requests to delete this invite while optionally specifying a reason.final OptionalInt
Gets an approximate count of total members, returned from theRoutes.INVITE_GET
endpoint whenwith_counts
is true.final OptionalInt
Gets an approximate count of online members, returned from theRoutes.INVITE_GET
endpoint whenwith_counts
is true.final Mono<CategorizableChannel>
Requests to retrieve the channel this invite is associated to.final Mono<CategorizableChannel>
getChannel
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the channel this invite is associated to, using the given retrieval strategy.final Snowflake
Gets the ID of the channel this invite is associated to.final GatewayDiscordClient
Returns theGatewayDiscordClient
that created this object.final String
getCode()
Gets the invite code (unique ID).getGuild()
Requests to retrieve the guild this invite is associated to, if present.getGuild
(EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the guild this invite is associated to, if present, using the given retrieval strategy.Gets the ID of the guild this invite is associated to.Gets the user who created the invite, if present.Gets the ID of the user who created the invite, if present.final Optional<Invite.Type>
Gets the type of target for this voice channel invite, if present.Gets the target user this invite is associated to, if present.Gets the ID of the target user this invite is associated to, if present.final Optional<Invite.Type>
Deprecated.toString()
-
Constructor Details
-
Invite
Constructs aInvite
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.
-
getCode
Gets the invite code (unique ID).- Returns:
- The invite code (unique ID).
-
getGuildId
Gets the ID of the guild this invite is associated to.- Returns:
- The ID of the guild this invite is associated to.
-
getGuild
Requests to retrieve the guild this invite is associated to, if present. -
getGuild
Requests to retrieve the guild this invite is associated to, if present, using the given retrieval strategy. -
getChannelId
Gets the ID of the channel this invite is associated to.- Returns:
- The ID of the channel this invite is associated to.
-
getChannel
Requests to retrieve the channel this invite is associated to. -
getChannel
Requests to retrieve the channel this invite is associated to, using the given retrieval strategy. -
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
Gets the user who created the invite, if present.- Returns:
- The user who created the invite, if present.
-
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
Gets the target user this invite is associated to, if present.- Returns:
- The target user this invite is associated to, if present.
-
getTargetUserType
Deprecated.UsegetTargetType()
Gets the type of target user for this invite, if present.- Returns:
- The type of target user for this invite, if present.
-
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
Gets an approximate count of online members, returned from theRoutes.INVITE_GET
endpoint whenwith_counts
is true.- Returns:
- An approximate count of online members, returned from the
Routes.INVITE_GET
endpoint whenwith_counts
is true.
-
getApproximateMemberCount
Gets an approximate count of total members, returned from theRoutes.INVITE_GET
endpoint whenwith_counts
is true.- Returns:
- An approximate count of total members, returned from the
Routes.INVITE_GET
endpoint whenwith_counts
is true.
-
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 theMono
.
-
delete
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 theMono
.
-
toString
-
getTargetType()