Class GenericGuildInviteEvent

java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.guild.GenericGuildEvent
net.dv8tion.jda.api.events.guild.invite.GenericGuildInviteEvent
All Implemented Interfaces:
GenericEvent
Direct Known Subclasses:
GuildInviteCreateEvent, GuildInviteDeleteEvent

public class GenericGuildInviteEvent extends GenericGuildEvent
Indicates that an Invite was created or deleted in a Guild.
Every GuildInviteEvent is derived from this event and can be casted.

Can be used to detect any GuildInviteEvent.

Requirements

These events require the GUILD_INVITES intent to be enabled.
These events will only fire for invite events that occur in channels where you can MANAGE_CHANNEL.

  • Constructor Details

    • GenericGuildInviteEvent

      public GenericGuildInviteEvent(@Nonnull JDA api, long responseNumber, @Nonnull String code, @Nonnull GuildChannel channel)
  • Method Details

    • getCode

      @Nonnull public String getCode()
      The invite code.
      This can be converted to a url with discord.gg/<code>.
      Returns:
      The invite code
    • getUrl

      @Nonnull public String getUrl()
      The invite url.
      This uses the https://discord.gg/<code> format.
      Returns:
      The invite url
    • getChannel

      @Nonnull public GuildChannelUnion getChannel()
      The GuildChannel this invite points to.
      Returns:
      GuildChannel
    • getChannelType

      @Nonnull public ChannelType getChannelType()
      The ChannelType for of the channel this invite points to.
      Returns:
      ChannelType