Package discord4j.rest.entity
Class RestInvite
java.lang.Object
discord4j.rest.entity.RestInvite
Represents a code that can be used to add a user to a guild.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RestInvite
create
(RestClient restClient, String code) Create aRestInvite
with the given parameters.Mono<discord4j.discordjson.json.InviteData>
Delete this resource from the Discord API.boolean
getCode()
Gets the invite code.Mono<discord4j.discordjson.json.InviteData>
getData()
Retrieve the contents of this REST entity from Discord API.Mono<discord4j.discordjson.json.InviteData>
Retrieve the contents of this REST entity from Discord API.int
hashCode()
-
Method Details
-
create
Create aRestInvite
with the given parameters. This method does not perform any API request.- Parameters:
restClient
- REST API resourcescode
- the ID of this entity- Returns:
- a
RestInvite
represented by the given parameters.
-
getCode
Gets the invite code.- Returns:
- The invite code
-
getData
Retrieve the contents of this REST entity from Discord API.- Returns:
- a Mono with the
InviteData
contents if successful, otherwise an error Mono
-
getData
public Mono<discord4j.discordjson.json.InviteData> getData(boolean withCounts, boolean withExpiration, @Nullable Snowflake guildScheduledEventId) Retrieve the contents of this REST entity from Discord API.- Parameters:
withCounts
- whether the invite should contain approximate member countswithExpiration
- whether the invite should contain the expiration dateguildScheduledEventId
- the guild scheduled event to include with the invite, can benull
- Returns:
- a Mono with the
InviteData
contents if successful, otherwise an error Mono
-
delete
Delete this resource from the Discord API.- Parameters:
reason
- include a reason for audit log purposes, can benull
- Returns:
- a Mono with the
InviteData
contents if successful, otherwise an empty Mono
-
equals
-
hashCode
public int hashCode()
-