Enum Permission

    • Enum Constant Detail

      • CREATE_INSTANT_INVITE

        public static final Permission CREATE_INSTANT_INVITE
      • KICK_MEMBERS

        public static final Permission KICK_MEMBERS
      • BAN_MEMBERS

        public static final Permission BAN_MEMBERS
      • ADMINISTRATOR

        public static final Permission ADMINISTRATOR
      • MANAGE_CHANNEL

        public static final Permission MANAGE_CHANNEL
      • MANAGE_SERVER

        public static final Permission MANAGE_SERVER
      • MESSAGE_ADD_REACTION

        public static final Permission MESSAGE_ADD_REACTION
      • VIEW_AUDIT_LOGS

        public static final Permission VIEW_AUDIT_LOGS
      • PRIORITY_SPEAKER

        public static final Permission PRIORITY_SPEAKER
      • VIEW_CHANNEL

        public static final Permission VIEW_CHANNEL
      • MESSAGE_READ

        public static final Permission MESSAGE_READ
      • MESSAGE_WRITE

        public static final Permission MESSAGE_WRITE
      • MESSAGE_TTS

        public static final Permission MESSAGE_TTS
      • MESSAGE_MANAGE

        public static final Permission MESSAGE_MANAGE
      • MESSAGE_EMBED_LINKS

        public static final Permission MESSAGE_EMBED_LINKS
      • MESSAGE_ATTACH_FILES

        public static final Permission MESSAGE_ATTACH_FILES
      • MESSAGE_HISTORY

        public static final Permission MESSAGE_HISTORY
      • MESSAGE_MENTION_EVERYONE

        public static final Permission MESSAGE_MENTION_EVERYONE
      • MESSAGE_EXT_EMOJI

        public static final Permission MESSAGE_EXT_EMOJI
      • VOICE_STREAM

        public static final Permission VOICE_STREAM
      • VOICE_CONNECT

        public static final Permission VOICE_CONNECT
      • VOICE_SPEAK

        public static final Permission VOICE_SPEAK
      • VOICE_MUTE_OTHERS

        public static final Permission VOICE_MUTE_OTHERS
      • VOICE_DEAF_OTHERS

        public static final Permission VOICE_DEAF_OTHERS
      • VOICE_MOVE_OTHERS

        public static final Permission VOICE_MOVE_OTHERS
      • VOICE_USE_VAD

        public static final Permission VOICE_USE_VAD
      • NICKNAME_CHANGE

        public static final Permission NICKNAME_CHANGE
      • NICKNAME_MANAGE

        public static final Permission NICKNAME_MANAGE
      • MANAGE_ROLES

        public static final Permission MANAGE_ROLES
      • MANAGE_PERMISSIONS

        public static final Permission MANAGE_PERMISSIONS
      • MANAGE_WEBHOOKS

        public static final Permission MANAGE_WEBHOOKS
      • MANAGE_EMOTES

        public static final Permission MANAGE_EMOTES
    • Field Detail

      • ALL_PERMISSIONS

        public static final long ALL_PERMISSIONS
        Represents a raw set of all permissions
      • ALL_CHANNEL_PERMISSIONS

        public static final long ALL_CHANNEL_PERMISSIONS
        All permissions that apply to a channel
      • ALL_GUILD_PERMISSIONS

        public static final long ALL_GUILD_PERMISSIONS
        All Guild specific permissions which are only available to roles
      • ALL_TEXT_PERMISSIONS

        public static final long ALL_TEXT_PERMISSIONS
        All text channel specific permissions which are only available in text channel permission overrides
      • ALL_VOICE_PERMISSIONS

        public static final long ALL_VOICE_PERMISSIONS
        All voice channel specific permissions which are only available in voice channel permission overrides
    • Method Detail

      • values

        public static Permission[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Permission c : Permission.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Permission valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getName

        @Nonnull
        public String getName()
        The readable name as used in the Discord client.
        Returns:
        The readable name of this Permission.
      • getOffset

        public int getOffset()
        The binary offset of the permission.
        For more information about Discord's offset system refer to Discord Permission Numbers.
        Returns:
        The offset that represents this Permission.
      • getRawValue

        public long getRawValue()
        The value of this permission when viewed as a raw value.
        This is equivalent to: 1 << getOffset()
        Returns:
        The raw value of this specific permission.
      • isGuild

        public boolean isGuild()
        Returns whether or not this Permission is present at the Guild level (configurable via Roles)
        Returns:
        True if this permission is present at the Guild level.
      • isChannel

        public boolean isChannel()
        Returns whether or not this Permission is present Channel level (configurable via PermissionsOverrides)
        Returns:
        True if this permission is present at the Channel level.
      • isText

        public boolean isText()
        Whether this permission is specifically for TextChannels
        Returns:
        True, if and only if this permission can only be applied to text channels
      • isVoice

        public boolean isVoice()
        Whether this permission is specifically for VoiceChannels
        Returns:
        True, if and only if this permission can only be applied to voice channels
      • getRaw

        public static long getRaw​(@Nonnull
                                  Permission... permissions)
        This is effectively the opposite of getPermissions(long), this takes 1 or more Permissions and returns the raw offset long representation of the permissions.
        Parameters:
        permissions - The array of permissions of which to form into the raw long representation.
        Returns:
        Unsigned long representing the provided permissions.
      • getRaw

        public static long getRaw​(@Nonnull
                                  Collection<Permission> permissions)
        This is effectively the opposite of getPermissions(long), this takes a Collection of Permissions and returns the raw offset long representation of the permissions.
        Example: getRaw(EnumSet.of(Permission.MESSAGE_READ, Permission.MESSAGE_WRITE))
        Parameters:
        permissions - The Collection of permissions of which to form into the raw long representation.
        Returns:
        Unsigned long representing the provided permissions.
        See Also:
        EnumSet