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 aPermissionOverridefor aGuildChannelwas 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 CategorygetCategory()TheCategorythis override belongs to.GuildChannelgetChannel()TheGuildChannelthis override belongs to.ChannelTypegetChannelType()TheChannelTypeof theGuildChannelthis override belongs to.MembergetMember()TheMemberfor the override.IPermissionHoldergetPermissionHolder()TheIPermissionHolderfor the override.PermissionOverridegetPermissionOverride()The affectedPermissionOverridethat was updated.RolegetRole()TheRolefor the override.StoreChannelgetStoreChannel()TheStoreChannelthis override belongs to.TextChannelgetTextChannel()TheTextChannelthis override belongs to.VoiceChannelgetVoiceChannel()TheVoiceChannelthis override belongs to.booleanisMemberOverride()Whether this override was for a member.booleanisRoleOverride()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()
TheChannelTypeof theGuildChannelthis override belongs to.- Returns:
- The
ChannelType
-
getChannel
@Nonnull public GuildChannel getChannel()
TheGuildChannelthis override belongs to.- Returns:
- The
GuildChannel
-
getTextChannel
@Nonnull public TextChannel getTextChannel()
TheTextChannelthis 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()
TheVoiceChannelthis 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()
TheStoreChannelthis 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 affectedPermissionOverridethat 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()
TheIPermissionHolderfor the override.
This can be aMemberorRole. If the role or member are not cached then this will be null.- Returns:
- Possibly-null permission holder
-
getMember
@Nullable public Member getMember()
TheMemberfor the override.
This can be null if the member is not cached or there is a discord inconsistency.- Returns:
- Possibly-null member
-
-