Class PermOverrideManager


  • public class PermOverrideManager
    extends net.dv8tion.jda.core.managers.impl.ManagerBase
    Manager providing functionality to update one or more fields for a PermissionOverride.

    Example

    
     manager.setDenied(Permission.MESSAGE_WRITE)
            .setAllowed(Permission.MESSAGE_READ)
            .queue();
     manager.reset(PermOverrideManager.DENIED | PermOverrideManager.ALLOWED)
            .grant(Permission.MESSAGE_WRITE)
            .clear(Permission.MESSAGE_MANAGE)
            .queue();
     
    See Also:
    PermissionOverride.getManager()
    • Field Detail

      • ALLOWED

        public static final long ALLOWED
        Used to reset the granted field
        See Also:
        Constant Field Values
      • PERMISSIONS

        public static final long PERMISSIONS
        Used to reset all permissions to their original value
        See Also:
        Constant Field Values
    • Constructor Detail

      • PermOverrideManager

        public PermOverrideManager​(PermissionOverride override)
        Creates a new PermOverrideManager instance
        Parameters:
        override - The PermissionOverride to manage
    • Method Detail

      • getGuild

        public Guild getGuild()
        The Guild this Manager's Channel is in.
        This is logically the same as calling getPermissionOverride().getGuild()
        Returns:
        The parent Guild
      • getChannel

        public Channel getChannel()
        The Channel this Manager's PermissionOverride is in.
        This is logically the same as calling getPermissionOverride().getChannel()
        Returns:
        The parent Channel
      • reset

        @CheckReturnValue
        public PermOverrideManager reset​(long fields)
        Resets the fields specified by the provided bit-flag pattern. You can specify a combination by using a bitwise OR concat of the flag constants.
        Example: manager.reset(PermOverrideManager.ALLOWED | PermOverrideManager.DENIED);

        Flag Constants:

        Overrides:
        reset in class net.dv8tion.jda.core.managers.impl.ManagerBase
        Parameters:
        fields - Integer value containing the flags to reset.
        Returns:
        PermOverrideManager for chaining convenience
      • reset

        @CheckReturnValue
        public PermOverrideManager reset​(long... fields)
        Resets the fields specified by the provided bit-flag patterns. You can specify a combination by using a bitwise OR concat of the flag constants.
        Example: manager.reset(PermOverrideManager.ALLOWED, PermOverrideManager.DENIED);

        Flag Constants:

        Overrides:
        reset in class net.dv8tion.jda.core.managers.impl.ManagerBase
        Parameters:
        fields - Integer values containing the flags to reset.
        Returns:
        PermOverrideManager for chaining convenience
      • reset

        @CheckReturnValue
        public PermOverrideManager reset()
        Resets all fields for this manager.
        Returns:
        PermOverrideManager for chaining convenience
      • clear

        @CheckReturnValue
        public PermOverrideManager clear​(long permissions)
        Clears the provided Permissions bits from the selected PermissionOverride.
        This will cause the provided Permissions to be inherited
        Parameters:
        permissions - The permissions to clear from the selected PermissionOverride
        Returns:
        PermOverrideManager for chaining convenience
      • clear

        @CheckReturnValue
        public PermOverrideManager clear​(Permission... permissions)
        Clears the provided Permissions bits from the selected PermissionOverride.
        This will cause the provided Permissions to be inherited
        Parameters:
        permissions - The permissions to clear from the selected PermissionOverride
        Returns:
        PermOverrideManager for chaining convenience
        Throws:
        java.lang.IllegalArgumentException - If any of the provided Permissions is null