Package discord4j.rest.util
Enum Permission
- java.lang.Object
-
- java.lang.Enum<Permission>
-
- discord4j.rest.util.Permission
-
- All Implemented Interfaces:
Serializable,Comparable<Permission>
public enum Permission extends Enum<Permission>
Permissions are a way to limit and grant certain abilities to users.- See Also:
- Permissions
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADD_REACTIONSAllows for the addition of reactions to messages.ADMINISTRATORAllows all permissions and bypasses channel permission overwrites.ATTACH_FILESAllows for uploading images and files.BAN_MEMBERSAllows banning members.CHANGE_NICKNAMEAllows for modification of own nickname.CONNECTAllows for joining of a voice channel.CREATE_INSTANT_INVITEAllows creation of instant invites.CREATE_PRIVATE_THREADSAllows for creating private threads.CREATE_PUBLIC_THREADSAllows for creating public and announcement threads.DEAFEN_MEMBERSAllows for deafening of members in a voice channel.EMBED_LINKSLinks sent by users with this permission will be auto-embedded.KICK_MEMBERSAllows kicking members.MANAGE_CHANNELSAllows management and editing of channels.MANAGE_EMOJISDeprecated.use the official permission name:MANAGE_GUILD_EXPRESSIONSMANAGE_EMOJIS_AND_STICKERSDeprecated.use the official permission name:MANAGE_GUILD_EXPRESSIONSMANAGE_EVENTSAllows for creating, editing, and deleting scheduled events.MANAGE_GUILDAllows management and editing of the guild.MANAGE_GUILD_EXPRESSIONSAllows management and editing of emojis, stickers, and soundboard sounds.MANAGE_MESSAGESAllows for deletion of other users messages.MANAGE_NICKNAMESAllows for modification of other users nicknames.MANAGE_ROLESAllows management and editing of roles.MANAGE_THREADSAllows for deleting and archiving threads, and viewing all private threads.MANAGE_WEBHOOKSAllows management and editing of webhooks.MENTION_EVERYONEAllows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel.MODERATE_MEMBERSAllows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.MOVE_MEMBERSAllows for moving of members between voice channels.MUTE_MEMBERSAllows for muting members in a voice channel.PRIORITY_SPEAKERAllows for using priority speaker in a voice channel.READ_MESSAGE_HISTORYAllows for reading of message history.REQUEST_TO_SPEAKAllows for requesting to speak in stage channels.SEND_MESSAGESAllows for sending messages in a channel and creating threads in a forum(does not allow sending messages in threads)SEND_MESSAGES_IN_THREADSAllows for sending messages in threadsSEND_TTS_MESSAGESAllows for sending of /tts messages.SEND_VOICE_MESSAGESAllows sending voice messages.SPEAKAllows for speaking in a voice channel.STREAMAllows for Stream in voice channel.USE_APPLICATION_COMMANDSAllows members to use application commands, including slash commands and context menu commands.USE_EMBEDDED_ACTIVITIESAllows for using Activities (applications with the EMBEDDED flag) in a voice channel.USE_EXTERNAL_EMOJISAllows the usage of custom emojis from other servers.USE_EXTERNAL_SOUNDSAllows the usage of custom soundboard sounds from other serversUSE_EXTERNAL_STICKERSAllows the usage of custom stickers from other servers.USE_SLASH_COMMANDSDeprecated.Deprecated in favor ofUSE_APPLICATION_COMMANDSUSE_SOUNDBOARDAllows for using soundboard in a voice channelUSE_VADAllows for using voice-activity-detection in a voice channel.VIEW_AUDIT_LOGAllows for viewing of audit logs.VIEW_CHANNELAllows guild members to view a channel, which includes reading messages in text channels and joining voice channels.VIEW_CREATOR_MONETIZATION_ANALYTICSAllows for viewing role subscription insightsVIEW_GUILD_INSIGHTSAllows for viewing guild insights.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetValue()Gets the permission's value.booleanrequiresMfa()Gets whether the permission requires the owner account to use multi-factor authentication when used on a guild that has server-side MFA enabled.static PermissionvalueOf(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.
-
-
-
Enum Constant Detail
-
CREATE_INSTANT_INVITE
public static final Permission CREATE_INSTANT_INVITE
Allows creation of instant invites.
-
KICK_MEMBERS
public static final Permission KICK_MEMBERS
Allows kicking members.
-
BAN_MEMBERS
public static final Permission BAN_MEMBERS
Allows banning members.
-
ADMINISTRATOR
public static final Permission ADMINISTRATOR
Allows all permissions and bypasses channel permission overwrites.
-
MANAGE_CHANNELS
public static final Permission MANAGE_CHANNELS
Allows management and editing of channels.
-
MANAGE_GUILD
public static final Permission MANAGE_GUILD
Allows management and editing of the guild.
-
ADD_REACTIONS
public static final Permission ADD_REACTIONS
Allows for the addition of reactions to messages.
-
VIEW_AUDIT_LOG
public static final Permission VIEW_AUDIT_LOG
Allows for viewing of audit logs.
-
PRIORITY_SPEAKER
public static final Permission PRIORITY_SPEAKER
Allows for using priority speaker in a voice channel.
-
STREAM
public static final Permission STREAM
Allows for Stream in voice channel.
-
VIEW_CHANNEL
public static final Permission VIEW_CHANNEL
Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels.
-
SEND_MESSAGES
public static final Permission SEND_MESSAGES
Allows for sending messages in a channel and creating threads in a forum(does not allow sending messages in threads)
-
SEND_TTS_MESSAGES
public static final Permission SEND_TTS_MESSAGES
Allows for sending of /tts messages.
-
MANAGE_MESSAGES
public static final Permission MANAGE_MESSAGES
Allows for deletion of other users messages.
-
EMBED_LINKS
public static final Permission EMBED_LINKS
Links sent by users with this permission will be auto-embedded.
-
ATTACH_FILES
public static final Permission ATTACH_FILES
Allows for uploading images and files.
-
READ_MESSAGE_HISTORY
public static final Permission READ_MESSAGE_HISTORY
Allows for reading of message history.
-
MENTION_EVERYONE
public static final Permission MENTION_EVERYONE
Allows for using the @everyone tag to notify all users in a channel, and the @here tag to notify all online users in a channel.
-
USE_EXTERNAL_EMOJIS
public static final Permission USE_EXTERNAL_EMOJIS
Allows the usage of custom emojis from other servers.
-
VIEW_GUILD_INSIGHTS
public static final Permission VIEW_GUILD_INSIGHTS
Allows for viewing guild insights.
-
CONNECT
public static final Permission CONNECT
Allows for joining of a voice channel.
-
SPEAK
public static final Permission SPEAK
Allows for speaking in a voice channel.
-
MUTE_MEMBERS
public static final Permission MUTE_MEMBERS
Allows for muting members in a voice channel.
-
DEAFEN_MEMBERS
public static final Permission DEAFEN_MEMBERS
Allows for deafening of members in a voice channel.
-
MOVE_MEMBERS
public static final Permission MOVE_MEMBERS
Allows for moving of members between voice channels.
-
USE_VAD
public static final Permission USE_VAD
Allows for using voice-activity-detection in a voice channel.
-
CHANGE_NICKNAME
public static final Permission CHANGE_NICKNAME
Allows for modification of own nickname.
-
MANAGE_NICKNAMES
public static final Permission MANAGE_NICKNAMES
Allows for modification of other users nicknames.
-
MANAGE_ROLES
public static final Permission MANAGE_ROLES
Allows management and editing of roles.
-
MANAGE_WEBHOOKS
public static final Permission MANAGE_WEBHOOKS
Allows management and editing of webhooks.
-
MANAGE_EMOJIS
@Deprecated public static final Permission MANAGE_EMOJIS
Deprecated.use the official permission name:MANAGE_GUILD_EXPRESSIONSAllows management and editing of emojis.
-
MANAGE_EMOJIS_AND_STICKERS
@Deprecated public static final Permission MANAGE_EMOJIS_AND_STICKERS
Deprecated.use the official permission name:MANAGE_GUILD_EXPRESSIONSAllows management and editing of emojis and stickers.
-
MANAGE_GUILD_EXPRESSIONS
public static final Permission MANAGE_GUILD_EXPRESSIONS
Allows management and editing of emojis, stickers, and soundboard sounds.
-
USE_SLASH_COMMANDS
@Deprecated public static final Permission USE_SLASH_COMMANDS
Deprecated.Deprecated in favor ofUSE_APPLICATION_COMMANDSAllows members to use slash commands in text channels.
-
USE_APPLICATION_COMMANDS
public static final Permission USE_APPLICATION_COMMANDS
Allows members to use application commands, including slash commands and context menu commands.
-
REQUEST_TO_SPEAK
@Experimental public static final Permission REQUEST_TO_SPEAK
Allows for requesting to speak in stage channels.
-
MANAGE_EVENTS
public static final Permission MANAGE_EVENTS
Allows for creating, editing, and deleting scheduled events.
-
MANAGE_THREADS
public static final Permission MANAGE_THREADS
Allows for deleting and archiving threads, and viewing all private threads.
-
CREATE_PUBLIC_THREADS
public static final Permission CREATE_PUBLIC_THREADS
Allows for creating public and announcement threads.
-
CREATE_PRIVATE_THREADS
public static final Permission CREATE_PRIVATE_THREADS
Allows for creating private threads.
-
USE_EXTERNAL_STICKERS
public static final Permission USE_EXTERNAL_STICKERS
Allows the usage of custom stickers from other servers.
-
SEND_MESSAGES_IN_THREADS
public static final Permission SEND_MESSAGES_IN_THREADS
Allows for sending messages in threads
-
USE_EMBEDDED_ACTIVITIES
public static final Permission USE_EMBEDDED_ACTIVITIES
Allows for using Activities (applications with the EMBEDDED flag) in a voice channel.
-
MODERATE_MEMBERS
public static final Permission MODERATE_MEMBERS
Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and from speaking in voice and stage channels.
-
VIEW_CREATOR_MONETIZATION_ANALYTICS
public static final Permission VIEW_CREATOR_MONETIZATION_ANALYTICS
Allows for viewing role subscription insights
-
USE_SOUNDBOARD
public static final Permission USE_SOUNDBOARD
Allows for using soundboard in a voice channel
-
USE_EXTERNAL_SOUNDS
public static final Permission USE_EXTERNAL_SOUNDS
Allows the usage of custom soundboard sounds from other servers
-
SEND_VOICE_MESSAGES
public static final Permission SEND_VOICE_MESSAGES
Allows sending voice messages.
-
-
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 nameNullPointerException- if the argument is null
-
requiresMfa
public boolean requiresMfa()
Gets whether the permission requires the owner account to use multi-factor authentication when used on a guild that has server-side MFA enabled.- Returns:
truewhen the permission requires the owner account to use multi-factor authentication when used on a guild that has server-side MFA enabled,falseotherwise.
-
getValue
public long getValue()
Gets the permission's value.- Returns:
- The permission's value.
-
-