Class InviteCreateEvent

java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.InviteCreateEvent

public class InviteCreateEvent extends Event
Dispatched when a new invite to a channel is created.

This event is dispatched by Discord.

See Also:
  • Constructor Details

  • Method Details

    • getGuildId

      public Optional<Snowflake> getGuildId()
      Gets the Snowflake ID of the Guild involved in the event, if present.
      Returns:
      The ID of the guild involved, if present.
    • getGuild

      public Mono<Guild> getGuild()
      Requests to retrieve the Guild that had an invite created in this event.
      Returns:
      A Mono where, upon successful completion, emits the Guild involved in the event. If an error is received, it is emitted through the Mono.
    • getChannelId

      public Snowflake getChannelId()
      Gets the Snowflake ID of the channel the invite is for.
      Returns:
      The ID of the channel involved.
    • getCode

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

      public Optional<User> getInviter()
      Gets the user that created the invite, if present.
      Returns:
      The user that created the invite, if present.
    • getUses

      public int getUses()
      Gets the number of times this invite has been used (always will be 0).
      Returns:
      The number of times this invite has been used (always will be 0).
    • 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.
    • getMaxAge

      public int getMaxAge()
      Gets how long the invite is valid for (in seconds).
      Returns:
      How long the invite is valid for (in seconds).
    • 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.
    • getExpiration

      public Optional<Instant> getExpiration()
      Gets the instant this invite expires, if possible.
      Returns:
      The instant this invite expires, if possible.
    • getInvite

      public Mono<Invite> getInvite()
      Requests to retrieve the invite Created.
      Returns:
      A Mono where, upon successful completion, emits the Invite. If an error is received, it is emitted through the Mono.
    • toString

      public String toString()
      Overrides:
      toString in class Object