diff --git a/src/main/java/net/dv8tion/jda/api/Permission.java b/src/main/java/net/dv8tion/jda/api/Permission.java index d2434c8c1d..313a4fbd3d 100644 --- a/src/main/java/net/dv8tion/jda/api/Permission.java +++ b/src/main/java/net/dv8tion/jda/api/Permission.java @@ -15,6 +15,8 @@ */ package net.dv8tion.jda.api; +import net.dv8tion.jda.annotations.ForRemoval; +import net.dv8tion.jda.annotations.ReplaceWith; import net.dv8tion.jda.internal.utils.Checks; import javax.annotation.Nonnull; @@ -29,16 +31,21 @@ public enum Permission { // General Server / Channel Permissions - MANAGE_CHANNEL( 4, true, true, "Manage Channels"), - MANAGE_SERVER( 5, true, false, "Manage Server"), - VIEW_AUDIT_LOGS( 7, true, false, "View Audit Logs"), - VIEW_CHANNEL( 10, true, true, "View Channel(s)"), - VIEW_GUILD_INSIGHTS( 19, true, false, "View Server Insights"), - MANAGE_ROLES( 28, true, false, "Manage Roles"), - MANAGE_PERMISSIONS( 28, false, true, "Manage Permissions"), - MANAGE_WEBHOOKS( 29, true, true, "Manage Webhooks"), - MANAGE_EMOJIS_AND_STICKERS(30, true, false, "Manage Emojis and Stickers"), - MANAGE_EVENTS( 33, true, true, "Manage Events"), + MANAGE_CHANNEL( 4, true, true, "Manage Channels"), + MANAGE_SERVER( 5, true, false, "Manage Server"), + VIEW_AUDIT_LOGS( 7, true, false, "View Audit Logs"), + VIEW_CHANNEL( 10, true, true, "View Channel(s)"), + VIEW_GUILD_INSIGHTS( 19, true, false, "View Server Insights"), + MANAGE_ROLES( 28, true, false, "Manage Roles"), + MANAGE_PERMISSIONS( 28, false, true, "Manage Permissions"), + MANAGE_WEBHOOKS( 29, true, true, "Manage Webhooks"), + @Deprecated + @ForRemoval(deadline = "5.0.0") + @ReplaceWith("MANAGE_GUILD_EXPRESSIONS") + MANAGE_EMOJIS_AND_STICKERS( 30, true, false, "Manage Emojis and Stickers"), + MANAGE_GUILD_EXPRESSIONS( 30, true, false, "Manage Emojis, Stickers, and Soundboards"), + MANAGE_EVENTS( 33, true, true, "Manage Events"), + VIEW_CREATOR_MONETIZATION_ANALYTICS(41, true, false, "View Creator Analytics"), // Membership Permissions CREATE_INSTANT_INVITE(0, true, true, "Create Instant Invite"), @@ -49,17 +56,18 @@ public enum Permission MODERATE_MEMBERS( 40, true, false, "Timeout Members"), // Text Permissions - MESSAGE_ADD_REACTION( 6, true, true, "Add Reactions"), - MESSAGE_SEND( 11, true, true, "Send Messages"), - MESSAGE_TTS( 12, true, true, "Send TTS Messages"), - MESSAGE_MANAGE( 13, true, true, "Manage Messages"), - MESSAGE_EMBED_LINKS( 14, true, true, "Embed Links"), - MESSAGE_ATTACH_FILES( 15, true, true, "Attach Files"), - MESSAGE_HISTORY( 16, true, true, "Read History"), - MESSAGE_MENTION_EVERYONE(17, true, true, "Mention Everyone"), - MESSAGE_EXT_EMOJI( 18, true, true, "Use External Emojis"), - USE_APPLICATION_COMMANDS(31, true, true, "Use Application Commands"), - MESSAGE_EXT_STICKER( 37, true, true, "Use External Stickers"), + MESSAGE_ADD_REACTION( 6, true, true, "Add Reactions"), + MESSAGE_SEND( 11, true, true, "Send Messages"), + MESSAGE_TTS( 12, true, true, "Send TTS Messages"), + MESSAGE_MANAGE( 13, true, true, "Manage Messages"), + MESSAGE_EMBED_LINKS( 14, true, true, "Embed Links"), + MESSAGE_ATTACH_FILES( 15, true, true, "Attach Files"), + MESSAGE_HISTORY( 16, true, true, "Read History"), + MESSAGE_MENTION_EVERYONE( 17, true, true, "Mention Everyone"), + MESSAGE_EXT_EMOJI( 18, true, true, "Use External Emojis"), + USE_APPLICATION_COMMANDS( 31, true, true, "Use Application Commands"), + MESSAGE_EXT_STICKER( 37, true, true, "Use External Stickers"), + MESSAGE_ATTACH_VOICE_MESSAGE(46, true, true, "Send Voice Messages"), // Thread Permissions MANAGE_THREADS( 34, true, true, "Manage Threads"), @@ -68,15 +76,17 @@ public enum Permission MESSAGE_SEND_IN_THREADS( 38, true, true, "Send Messages in Threads"), // Voice Permissions - PRIORITY_SPEAKER( 8, true, true, "Priority Speaker"), - VOICE_STREAM( 9, true, true, "Video"), - VOICE_CONNECT( 20, true, true, "Connect"), - VOICE_SPEAK( 21, true, true, "Speak"), - VOICE_MUTE_OTHERS( 22, true, true, "Mute Members"), - VOICE_DEAF_OTHERS( 23, true, true, "Deafen Members"), - VOICE_MOVE_OTHERS( 24, true, true, "Move Members"), - VOICE_USE_VAD( 25, true, true, "Use Voice Activity"), - VOICE_START_ACTIVITIES(39, true, true, "Launch Activities in Voice Channels"), + PRIORITY_SPEAKER( 8, true, true, "Priority Speaker"), + VOICE_STREAM( 9, true, true, "Video"), + VOICE_CONNECT( 20, true, true, "Connect"), + VOICE_SPEAK( 21, true, true, "Speak"), + VOICE_MUTE_OTHERS( 22, true, true, "Mute Members"), + VOICE_DEAF_OTHERS( 23, true, true, "Deafen Members"), + VOICE_MOVE_OTHERS( 24, true, true, "Move Members"), + VOICE_USE_VAD( 25, true, true, "Use Voice Activity"), + VOICE_START_ACTIVITIES( 39, true, true, "Use Activities"), + VOICE_USE_SOUNDBOARD( 42, true, true, "Use Soundboard"), + VOICE_USE_EXTERNAL_SOUNDS(45, true, true, "Use External Sounds"), // Stage Channel Permissions REQUEST_TO_SPEAK( 32, true, true, "Request to Speak"), @@ -117,7 +127,7 @@ public enum Permission = Permission.getRaw(MESSAGE_ADD_REACTION, MESSAGE_SEND, MESSAGE_TTS, MESSAGE_MANAGE, MESSAGE_EMBED_LINKS, MESSAGE_ATTACH_FILES, MESSAGE_EXT_EMOJI, MESSAGE_EXT_STICKER, MESSAGE_HISTORY, MESSAGE_MENTION_EVERYONE, USE_APPLICATION_COMMANDS, - MANAGE_THREADS, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, MESSAGE_SEND_IN_THREADS); + MANAGE_THREADS, CREATE_PUBLIC_THREADS, CREATE_PRIVATE_THREADS, MESSAGE_SEND_IN_THREADS, MESSAGE_ATTACH_VOICE_MESSAGE); /** * All voice channel specific permissions which are only available in voice channel permission overrides @@ -125,7 +135,8 @@ public enum Permission public static final long ALL_VOICE_PERMISSIONS = Permission.getRaw(VOICE_STREAM, VOICE_CONNECT, VOICE_SPEAK, VOICE_MUTE_OTHERS, VOICE_DEAF_OTHERS, VOICE_MOVE_OTHERS, VOICE_USE_VAD, - PRIORITY_SPEAKER, REQUEST_TO_SPEAK, VOICE_START_ACTIVITIES); + PRIORITY_SPEAKER, REQUEST_TO_SPEAK, VOICE_START_ACTIVITIES, + VOICE_USE_SOUNDBOARD, VOICE_USE_EXTERNAL_SOUNDS); private final int offset; private final long raw; diff --git a/src/main/java/net/dv8tion/jda/api/entities/Guild.java b/src/main/java/net/dv8tion/jda/api/entities/Guild.java index e7cfa53ca7..42f783c0d6 100644 --- a/src/main/java/net/dv8tion/jda/api/entities/Guild.java +++ b/src/main/java/net/dv8tion/jda/api/entities/Guild.java @@ -1870,7 +1870,7 @@ default List getStickersByName(@Nonnull String name, boolean ignor * Retrieves an immutable list of Custom Emojis together with their respective creators. * *

Note that {@link RichCustomEmoji#getOwner()} is only available if the currently - * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS Permission.MANAGE_EMOJIS_AND_STICKERS}. + * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS Permission.MANAGE_GUILD_EXPRESSIONS}. * * @return {@link RestAction RestAction} - Type: List of {@link RichCustomEmoji} */ @@ -1883,7 +1883,7 @@ default List getStickersByName(@Nonnull String name, boolean ignor *
This does not include unicode emoji. * *

Note that {@link RichCustomEmoji#getOwner()} is only available if the currently - * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS Permission.MANAGE_EMOJIS_AND_STICKERS}. + * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS Permission.MANAGE_GUILD_EXPRESSIONS}. * *

Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by * the returned {@link RestAction RestAction} include the following: @@ -1908,7 +1908,7 @@ default List getStickersByName(@Nonnull String name, boolean ignor * Retrieves a Custom Emoji together with its respective creator. * *

Note that {@link RichCustomEmoji#getOwner()} is only available if the currently - * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS Permission.MANAGE_EMOJIS_AND_STICKERS}. + * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS Permission.MANAGE_GUILD_EXPRESSIONS}. * *

Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by * the returned {@link RestAction RestAction} include the following: @@ -1933,7 +1933,7 @@ default RestAction retrieveEmojiById(long id) * Retrieves a custom emoji together with its respective creator. * *

Note that {@link RichCustomEmoji#getOwner()} is only available if the currently - * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS Permission.MANAGE_EMOJIS_AND_STICKERS}. + * logged in account has {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS Permission.MANAGE_GUILD_EXPRESSIONS}. * *

Possible {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses} caused by * the returned {@link RestAction RestAction} include the following: @@ -1961,7 +1961,7 @@ default RestAction retrieveEmoji(@Nonnull CustomEmoji emoji) if (emoji instanceof RichCustomEmoji) { RichCustomEmoji richEmoji = (RichCustomEmoji) emoji; - if (richEmoji.getOwner() != null || !getSelfMember().hasPermission(Permission.MANAGE_EMOJIS_AND_STICKERS)) + if (richEmoji.getOwner() != null || !getSelfMember().hasPermission(Permission.MANAGE_GUILD_EXPRESSIONS)) return richEmoji; } return null; @@ -2014,7 +2014,7 @@ default RestAction retrieveEmoji(@Nonnull CustomEmoji emoji) * @throws IllegalArgumentException * If null is provided * @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException - * If the currently logged in account does not have {@link Permission#MANAGE_EMOJIS_AND_STICKERS MANAGE_EMOJIS_AND_STICKERS} in the guild. + * If the currently logged in account does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS MANAGE_GUILD_EXPRESSIONS} in the guild. * * @return {@link GuildStickerManager} */ @@ -4533,7 +4533,7 @@ default RoleAction createCopyOfRole(@Nonnull Role role) /** * Creates a new {@link RichCustomEmoji} in this Guild. *
If one or more Roles are specified the new emoji will only be available to Members with any of the specified Roles (see {@link Member#canInteract(RichCustomEmoji)}) - *
For this to be successful, the logged in account has to have the {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS MANAGE_EMOJIS_AND_STICKERS} Permission. + *
For this to be successful, the logged in account has to have the {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS MANAGE_GUILD_EXPRESSIONS} Permission. * *

Unicode emojis are not included as {@link RichCustomEmoji}! * @@ -4558,7 +4558,7 @@ default RoleAction createCopyOfRole(@Nonnull Role role) *
If no roles are provided the emoji will be available to all Members of this Guild * * @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException - * If the logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS MANAGE_EMOJIS_AND_STICKERS} Permission + * If the logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS MANAGE_GUILD_EXPRESSIONS} Permission * * @return {@link net.dv8tion.jda.api.requests.restaction.AuditableRestAction AuditableRestAction} - Type: {@link RichCustomEmoji} */ @@ -4587,7 +4587,7 @@ default RoleAction createCopyOfRole(@Nonnull Role role) * The tags to use for auto-suggestions (Up to 200 characters in total) * * @throws InsufficientPermissionException - * If the currently logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_EMOJIS_AND_STICKERS MANAGE_EMOJIS_AND_STICKERS} permission + * If the currently logged in account does not have the {@link net.dv8tion.jda.api.Permission#MANAGE_GUILD_EXPRESSIONS MANAGE_GUILD_EXPRESSIONS} permission * @throws IllegalArgumentException *