Class GenericPermissionOverrideEvent

    • Constructor Detail

      • GenericPermissionOverrideEvent

        public GenericPermissionOverrideEvent​(@Nonnull
                                              JDA api,
                                              long responseNumber,
                                              @Nonnull
                                              GuildChannel channel,
                                              @Nonnull
                                              PermissionOverride override)
    • Method Detail

      • getCategory

        @Nonnull
        public Category getCategory()
        The Category this override belongs to.
        Note: This is not the same as getChannel().getParent()!
        Returns:
        Category
        Throws:
        java.lang.IllegalStateException - If the override does not belong to a Category
        See Also:
        getChannel(), getChannelType()
      • 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