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
ConstructorDescriptionGenericGuildInviteEvent
(JDA api, long responseNumber, String code, GuildChannel channel) -
Method Summary
Modifier and TypeMethodDescriptionTheCategory
this invite points to.TheGuildChannel
this invite points to.TheChannelType
for of thechannel
this invite points to.getCode()
The invite code.TheNewsChannel
this invite points to.TheStageChannel
this invite points to.TheStoreChannel
this invite points to.TheTextChannel
this invite points to.getUrl()
The invite url.TheVoiceChannel
this invite points to.Methods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuild
Methods 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
TheGuildChannel
this invite points to.- Returns:
GuildChannel
-
getChannelType
TheChannelType
for of thechannel
this invite points to.- Returns:
ChannelType
-
getTextChannel
TheTextChannel
this invite points to.- Returns:
TextChannel
- Throws:
IllegalStateException
- If this did not happen in a channel of typeChannelType.TEXT
- See Also:
-
getNewsChannel
TheNewsChannel
this invite points to.- Returns:
NewsChannel
- Throws:
IllegalStateException
- If this did not happen in a channel of typeChannelType.NEWS
- See Also:
-
getVoiceChannel
TheVoiceChannel
this invite points to.- Returns:
VoiceChannel
- Throws:
IllegalStateException
- If this did not happen in a voice channel or stage channel- See Also:
-
getStageChannel
TheStageChannel
this invite points to.- Returns:
StageChannel
- Throws:
IllegalStateException
- If this did not happen in a channel of typeChannelType.STAGE
- See Also:
-
getStoreChannel
TheStoreChannel
this invite points to.- Returns:
StoreChannel
- Throws:
IllegalStateException
- If this did not happen in a channel of typeChannelType.STORE
- See Also:
-
getCategory
TheCategory
this invite points to.- Returns:
Category
- Throws:
IllegalStateException
- If this did not happen in a channel of typeChannelType.CATEGORY
- See Also:
-