Class ExtendedInvite

java.lang.Object
discord4j.core.object.Invite
discord4j.core.object.ExtendedInvite
All Implemented Interfaces:
DiscordObject

public final class ExtendedInvite extends Invite
Metadata for a Discord invite.
See Also:
  • Constructor Details

    • ExtendedInvite

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

    • getUses

      public int getUses()
      Gets the number of times this invite has been used.
      Returns:
      The number of times this invite has been used.
    • getMaxUses

      public int getMaxUses()
      Gets the max number of times this invite can be used.
      Returns:
      The max number of times this invite can be used.
    • getExpiration

      public Optional<Instant> getExpiration()
      Gets the instant this invite expires, if possible.
      Returns:
      The instant this invite expires, if empty, invite is never expiring.
    • isTemporary

      public boolean isTemporary()
      Gets whether this invite only grants temporary membership.
      Returns:
      true if this invite only grants temporary membership
    • getCreation

      public Instant getCreation()
      Gets when this invite was created.
      Returns:
      When this invite was created.
    • toString

      public String toString()
      Overrides:
      toString in class Invite