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
Indicates that an
Every GuildInviteEvent is derived from this event and can be casted.
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 Summary
ConstructorsConstructorDescriptionGenericGuildInviteEvent(JDA api, long responseNumber, String code, GuildChannel channel) -
Method Summary
Modifier and TypeMethodDescriptionTheCategorythis invite points to.TheGuildChannelthis invite points to.TheChannelTypefor of thechannelthis invite points to.getCode()The invite code.TheNewsChannelthis invite points to.TheStageChannelthis invite points to.TheStoreChannelthis invite points to.TheTextChannelthis invite points to.getUrl()The invite url.TheVoiceChannelthis invite points to.Methods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuildMethods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
Constructor Details
-
GenericGuildInviteEvent
-
-
Method Details
-
getCode
The invite code.
This can be converted to a url withdiscord.gg/<code>.- Returns:
- The invite code
-
getUrl
The invite url.
This uses thehttps://discord.gg/<code>format.- Returns:
- The invite url
-
getChannel
TheGuildChannelthis invite points to.- Returns:
GuildChannel
-
getChannelType
TheChannelTypefor of thechannelthis invite points to.- Returns:
ChannelType
-
getTextChannel
TheTextChannelthis invite points to.- Returns:
TextChannel- Throws:
IllegalStateException- If this did not happen in a channel of typeChannelType.TEXT- See Also:
-
getNewsChannel
TheNewsChannelthis invite points to.- Returns:
NewsChannel- Throws:
IllegalStateException- If this did not happen in a channel of typeChannelType.NEWS- See Also:
-
getVoiceChannel
TheVoiceChannelthis invite points to.- Returns:
VoiceChannel- Throws:
IllegalStateException- If this did not happen in a voice channel or stage channel- See Also:
-
getStageChannel
TheStageChannelthis invite points to.- Returns:
StageChannel- Throws:
IllegalStateException- If this did not happen in a channel of typeChannelType.STAGE- See Also:
-
getStoreChannel
TheStoreChannelthis invite points to.- Returns:
StoreChannel- Throws:
IllegalStateException- If this did not happen in a channel of typeChannelType.STORE- See Also:
-
getCategory
TheCategorythis invite points to.- Returns:
Category- Throws:
IllegalStateException- If this did not happen in a channel of typeChannelType.CATEGORY- See Also:
-