Class RestInvite


  • public class RestInvite
    extends Object
    Represents a code that can be used to add a user to a guild.
    • Method Detail

      • create

        public static RestInvite create​(RestClient restClient,
                                        String code)
        Create a RestInvite with the given parameters. This method does not perform any API request.
        Parameters:
        restClient - REST API resources
        code - the ID of this entity
        Returns:
        a RestInvite represented by the given parameters.
      • getCode

        public String getCode()
        Gets the invite code.
        Returns:
        The invite code
      • getData

        public Mono<discord4j.discordjson.json.InviteData> 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 counts
        withExpiration - whether the invite should contain the expiration date
        guildScheduledEventId - the guild scheduled event to include with the invite, can be null
        Returns:
        a Mono with the InviteData contents if successful, otherwise an error Mono
      • delete

        public Mono<discord4j.discordjson.json.InviteData> delete​(@Nullable
                                                                  String reason)
        Delete this resource from the Discord API.
        Parameters:
        reason - include a reason for audit log purposes, can be null
        Returns:
        a Mono with the InviteData contents if successful, otherwise an empty Mono
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object