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
public class GenericPermissionOverrideEvent extends GenericGuildEvent
Indicates that aPermissionOverride
for aGuildChannel
was created, deleted, or updated.
Every guild channel override event is a subclass of this event and can be castedCan be used to detect that any guild channel override event was fired
-
-
Constructor Summary
Constructors Constructor Description GenericPermissionOverrideEvent(JDA api, long responseNumber, GuildChannel channel, PermissionOverride override)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Category
getCategory()
TheCategory
this override belongs to.GuildChannel
getChannel()
TheGuildChannel
this override belongs to.ChannelType
getChannelType()
TheChannelType
of theGuildChannel
this override belongs to.Member
getMember()
TheMember
for the override.IPermissionHolder
getPermissionHolder()
TheIPermissionHolder
for the override.PermissionOverride
getPermissionOverride()
The affectedPermissionOverride
that was updated.Role
getRole()
TheRole
for the override.StoreChannel
getStoreChannel()
TheStoreChannel
this override belongs to.TextChannel
getTextChannel()
TheTextChannel
this override belongs to.VoiceChannel
getVoiceChannel()
TheVoiceChannel
this override belongs to.boolean
isMemberOverride()
Whether this override was for a member.boolean
isRoleOverride()
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 Detail
-
GenericPermissionOverrideEvent
public GenericPermissionOverrideEvent(@Nonnull JDA api, long responseNumber, @Nonnull GuildChannel channel, @Nonnull PermissionOverride override)
-
-
Method Detail
-
getChannelType
@Nonnull public ChannelType getChannelType()
TheChannelType
of theGuildChannel
this override belongs to.- Returns:
- The
ChannelType
-
getChannel
@Nonnull public GuildChannel getChannel()
TheGuildChannel
this override belongs to.- Returns:
- The
GuildChannel
-
getTextChannel
@Nonnull public TextChannel getTextChannel()
TheTextChannel
this override belongs to.- Returns:
TextChannel
- Throws:
java.lang.IllegalStateException
- If the override does not belong to a TextChannel- See Also:
getChannel()
,getChannelType()
-
getVoiceChannel
@Nonnull public VoiceChannel getVoiceChannel()
TheVoiceChannel
this override belongs to.- Returns:
VoiceChannel
- Throws:
java.lang.IllegalStateException
- If the override does not belong to a VoiceChannel- See Also:
getChannel()
,getChannelType()
-
getStoreChannel
@Nonnull public StoreChannel getStoreChannel()
TheStoreChannel
this override belongs to.- Returns:
StoreChannel
- Throws:
java.lang.IllegalStateException
- If the override does not belong to a StoreChannel- See Also:
getChannel()
,getChannelType()
-
getCategory
@Nonnull public Category getCategory()
- Returns:
Category
- Throws:
java.lang.IllegalStateException
- If the override does not belong to a Category- See Also:
getChannel()
,getChannelType()
-
getPermissionOverride
@Nonnull public PermissionOverride 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
@Nullable public IPermissionHolder 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
@Nullable public Member 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
-
-