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 a 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 Details

  • Method Details

    • getChannelType

      @Nonnull public ChannelType getChannelType()
      The ChannelType of the GuildChannel this override belongs to.
      Returns:
      The ChannelType
    • getChannel

      @Nonnull public IPermissionContainerUnion getChannel()
      The guild channel this override belongs to.
      Returns:
      The channel
    • getPermissionOverride

      @Nonnull public PermissionOverride getPermissionOverride()
      The affected PermissionOverride that was updated.
      Returns:
      The override
    • isRoleOverride

      public boolean isRoleOverride()
      Whether this override was for a role.
      This means getRole() 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 that getMember() 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()
      The IPermissionHolder for the override.
      This can be a Member or Role. If the role or member are not cached then this will be null.
      Returns:
      Possibly-null permission holder
    • getMember

      @Nullable public Member getMember()
      The Member for the override.
      This can be null if the member is not cached or there is a discord inconsistency.
      Returns:
      Possibly-null member
    • getRole

      @Nullable public Role getRole()
      The Role for the override.
      Returns:
      Possibly-null role