Class GenericPermissionOverrideEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.guild.GenericGuildEvent
net.dv8tion.jda.api.events.guild.override.GenericPermissionOverrideEvent
- All Implemented Interfaces:
GenericEvent
- Direct Known Subclasses:
PermissionOverrideCreateEvent
,PermissionOverrideDeleteEvent
,PermissionOverrideUpdateEvent
Indicates that a
Every guild channel override event is a subclass of this event and can be casted
PermissionOverride
for a GuildChannel
was created, deleted, or updated.
Every guild channel override event is a subclass of this event and can be casted
Can be used to detect that any guild channel override event was fired
-
Constructor Summary
ConstructorDescriptionGenericPermissionOverrideEvent
(JDA api, long responseNumber, GuildChannel channel, PermissionOverride override) -
Method Summary
Modifier and TypeMethodDescriptionTheCategory
this override belongs to.TheGuildChannel
this override belongs to.TheChannelType
of theGuildChannel
this override belongs to.TheMember
for the override.TheNewsChannel
this override belongs to.TheIPermissionHolder
for the override.The affectedPermissionOverride
that was updated.getRole()
TheRole
for the override.TheStoreChannel
this override belongs to.TheTextChannel
this override belongs to.TheVoiceChannel
this override belongs to.boolean
Whether this override was for a member.boolean
Whether this override was for a role.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
-
GenericPermissionOverrideEvent
public GenericPermissionOverrideEvent(@Nonnull JDA api, long responseNumber, @Nonnull GuildChannel channel, @Nonnull PermissionOverride override)
-
-
Method Details
-
getChannelType
TheChannelType
of theGuildChannel
this override belongs to.- Returns:
- The
ChannelType
-
getChannel
TheGuildChannel
this override belongs to.- Returns:
- The
GuildChannel
-
getTextChannel
TheTextChannel
this override belongs to.- Returns:
TextChannel
- Throws:
IllegalStateException
- If the override does not belong to a TextChannel- See Also:
-
getNewsChannel
TheNewsChannel
this override belongs to.- Returns:
NewsChannel
- Throws:
IllegalStateException
- If the override does not belong to a NewsChannel- See Also:
-
getVoiceChannel
TheVoiceChannel
this override belongs to.- Returns:
VoiceChannel
- Throws:
IllegalStateException
- If the override does not belong to a VoiceChannel- See Also:
-
getStoreChannel
TheStoreChannel
this override belongs to.- Returns:
StoreChannel
- Throws:
IllegalStateException
- If the override does not belong to a StoreChannel- See Also:
-
getCategory
TheCategory
this override belongs to.
Note: This is not the same asgetChannel().getParentCategory()
!- Returns:
Category
- Throws:
IllegalStateException
- If the override does not belong to a Category- See Also:
-
getPermissionOverride
The affectedPermissionOverride
that was updated.- Returns:
- The override
-
isRoleOverride
public boolean isRoleOverride()Whether this override was for a role.
This meansgetRole()
is likely not null.- Returns:
- True, if this override is for a role
-
isMemberOverride
public boolean isMemberOverride()Whether this override was for a member.
Note thatgetMember()
might still be null if the member isn't cached or there is a discord inconsistency.- Returns:
- True, if this override is for a member
-
getPermissionHolder
TheIPermissionHolder
for the override.
This can be aMember
orRole
. If the role or member are not cached then this will be null.- Returns:
- Possibly-null permission holder
-
getMember
TheMember
for the override.
This can be null if the member is not cached or there is a discord inconsistency.- Returns:
- Possibly-null member
-
getRole
TheRole
for the override.- Returns:
- Possibly-null role
-