public enum Permission extends java.lang.Enum<Permission>
Modifier and Type | Method and Description |
---|---|
static Permission |
getFromOffset(int offset)
Gets the
Permission relating to the provided offset.If there is no Permssions that matches the provided
offset, Permission.UNKNOWN is returned. |
int |
getOffset()
The binary offset of the permission.
For more information about Discord's offset system refer to Discord Permission Numbers. |
static java.util.List<Permission> |
getPermissions(int permissions)
A list of all
Permissions that are specified by this raw int representation of
permissions. |
static Permission |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Permission[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Permission CREATE_INSTANT_INVITE
public static final Permission KICK_MEMBERS
public static final Permission BAN_MEMBERS
public static final Permission MANAGE_ROLES
public static final Permission MANAGE_PERMISSIONS
public static final Permission MANAGE_CHANNEL
public static final Permission MANAGE_SERVER
public static final Permission MESSAGE_READ
public static final Permission MESSAGE_WRITE
public static final Permission MESSAGE_TTS
public static final Permission MESSAGE_MANAGE
public static final Permission MESSAGE_EMBED_LINKS
public static final Permission MESSAGE_ATTACH_FILES
public static final Permission MESSAGE_HISTORY
public static final Permission MESSAGE_MENTION_EVERYONE
public static final Permission VOICE_CONNECT
public static final Permission VOICE_SPEAK
public static final Permission VOICE_MUTE_OTHERS
public static final Permission VOICE_DEAF_OTHERS
public static final Permission VOICE_MOVE_OTHERS
public static final Permission VOICE_USE_VAD
public static final Permission UNKNOWN
public static Permission[] values()
for (Permission c : Permission.values()) System.out.println(c);
public static Permission valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getOffset()
Permission
.public static Permission getFromOffset(int offset)
Permission
relating to the provided offset.Permssions
that matches the provided
offset, Permission.UNKNOWN
is returned.offset
- The offset to match a Permission
to.Permission
relating to the provided offset.public static java.util.List<Permission> getPermissions(int permissions)
Permissions
that are specified by this raw int representation of
permissions. The is best used with the getRaw methods in Role
,
PermissionOverride
or PermissionUtil
.
Examples:
PermissionUtil.getEffectivePermission(user, channel)
PermissionOverride.getAllowedRaw()
Role.getPermissionsRaw()
permissions
- The raw int
representation of permissions.Permissions
.