diff --git a/src/main/java/net/dv8tion/jda/api/JDA.java b/src/main/java/net/dv8tion/jda/api/JDA.java index 6a929fdbac..442e979ee8 100644 --- a/src/main/java/net/dv8tion/jda/api/JDA.java +++ b/src/main/java/net/dv8tion/jda/api/JDA.java @@ -1786,7 +1786,7 @@ default List getEmojisByName(@Nonnull String name, boolean igno RestAction<@Unmodifiable List> retrieveNitroStickerPacks(); /** - * Retrieves a list of the default {@link SoundboardSound soundboard sounds}. + * Retrieves a list of the default {@link SoundboardSound SoundboardSounds}. * * @return {@link RestAction} - Type: List of {@link SoundboardSound} */ 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 5c6a9cee51..7eae91c33d 100644 --- a/src/main/java/net/dv8tion/jda/api/entities/Guild.java +++ b/src/main/java/net/dv8tion/jda/api/entities/Guild.java @@ -2102,10 +2102,10 @@ default SoundboardSound getSoundboardSoundById(long id) * *

This copies the backing store into a list. This means every call * creates a new list with O(n) complexity. It is recommended to store this into - * a local variable or use {@link #getStickerCache()} and use its more efficient + * a local variable or use {@link #getSoundboardSoundCache()} and use its more efficient * versions of handling these values. * - *

This requires the {@link CacheFlag#STICKER} to be enabled! + *

This requires the {@link CacheFlag#SOUNDBOARD_SOUNDS} to be enabled! * * @return An immutable List of {@link SoundboardSound SoundboardSounds}. */ @@ -2128,7 +2128,7 @@ default List getSoundboardSounds() * @param ignoreCase * Determines if the comparison ignores case when comparing. True - case insensitive. * - * @return Possibly-empty immutable list of all Soundboard sounds that match the provided name. + * @return Possibly-empty immutable list of all SoundboardSounds that match the provided name. */ @Nonnull @Unmodifiable @@ -5112,7 +5112,7 @@ default AuditableRestAction createSticker(@Nonnull String name, @N /** * Creates a soundboard sound in the guild. * - *

The returned {@link RestAction} can encounter the following Discord errors: + *

The returned {@link RestAction} can encounter the following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses}: *

* + * @param name + * The name of the soundboard sound, must be between 2-32 characters * @param file * The file to use as the sound, can be an MP3 or an OGG file * * @throws IllegalArgumentException - * If {@code null} is provided, or {@code name} is not between 2-32 characters + * * @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException * If the currently logged in account does not have {@link Permission#CREATE_GUILD_EXPRESSIONS CREATE_GUILD_EXPRESSIONS} in the guild. * diff --git a/src/main/java/net/dv8tion/jda/api/entities/SoundboardSound.java b/src/main/java/net/dv8tion/jda/api/entities/SoundboardSound.java index 01494a90e4..6221ac27ae 100644 --- a/src/main/java/net/dv8tion/jda/api/entities/SoundboardSound.java +++ b/src/main/java/net/dv8tion/jda/api/entities/SoundboardSound.java @@ -102,7 +102,7 @@ default String getUrl() /** * The user which created this sound. * - *

This is present only if the {@link Guild#getSelfMember() current member} has + *

This is present only if the {@link Guild#getSelfMember() self member} has * the {@link Permission#CREATE_GUILD_EXPRESSIONS CREATE_GUILD_EXPRESSIONS} * or {@link Permission#MANAGE_GUILD_EXPRESSIONS MANAGE_GUILD_EXPRESSIONS} permission. * @@ -116,27 +116,31 @@ default String getUrl() *
You must be connected to the voice channel to use this method, * as well as be able to speak and hear. * - *

Possible {@link ErrorResponse ErrorResponses} caused by - * the returned {@link RestAction} include the following: + *

The returned {@link RestAction} can encounter the following {@link ErrorResponse ErrorResponses}: *

* * @param channel * The channel to send this sound on * * @throws InsufficientPermissionException - * If the logged in account does not have the {@link Permission#VOICE_SPEAK VOICE_SPEAK}, - * {@link Permission#VOICE_USE_SOUNDBOARD VOICE_USE_SOUNDBOARD}, - * or {@link Permission#VOICE_USE_EXTERNAL_SOUNDS VOICE_USE_EXTERNAL_SOUNDS} permission. + * If the bot does not have the following permissions: + * * @throws IllegalArgumentException * If the provided channel is {@code null} * @throws IllegalStateException * @@ -147,10 +151,49 @@ default String getUrl() @CheckReturnValue RestAction sendTo(VoiceChannel channel); + /** + * Deletes this soundboard sound. + * + *

The returned {@link RestAction} can encounter the following {@link ErrorResponse ErrorResponses}: + *

    + *
  • {@link ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS} + *
    The sound cannot be deleted due to a permission discrepancy
  • + *
  • {@link ErrorResponse#UNKNOWN_SOUND UNKNOWN_SOUND} + *
    The sound was deleted
  • + *
+ * + * @throws InsufficientPermissionException + *
    + *
  • If the bot does not own this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS}
  • + *
  • If the bot owns this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS} or {@link Permission#CREATE_GUILD_EXPRESSIONS}
  • + *
+ * + * @return {@link RestAction} - Type: {@link Void} + */ @Nonnull @CheckReturnValue RestAction delete(); + /** + * The {@link SoundboardSoundManager} for this soundboard sound, in which you can modify values. + *
You modify multiple fields in one request by chaining setters before calling {@link RestAction#queue()}. + * + *

The returned {@link RestAction} can encounter the following {@link ErrorResponse ErrorResponses}: + *

    + *
  • {@link ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS} + *
    The sound cannot be edited due to a permission discrepancy
  • + *
  • {@link ErrorResponse#UNKNOWN_SOUND UNKNOWN_SOUND} + *
    The sound was deleted
  • + *
+ * + * @throws InsufficientPermissionException + *
    + *
  • If the bot does not own this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS}
  • + *
  • If the bot owns this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS} or {@link Permission#CREATE_GUILD_EXPRESSIONS}
  • + *
+ * + * @return The SoundboardSoundManager of this soundboard sound + */ @Nonnull @CheckReturnValue SoundboardSoundManager getManager(); diff --git a/src/main/java/net/dv8tion/jda/api/events/soundboard/update/package-info.java b/src/main/java/net/dv8tion/jda/api/events/soundboard/update/package-info.java index 9da41434aa..5a26ea9abc 100644 --- a/src/main/java/net/dv8tion/jda/api/events/soundboard/update/package-info.java +++ b/src/main/java/net/dv8tion/jda/api/events/soundboard/update/package-info.java @@ -15,7 +15,7 @@ */ /** - * Events that track updates for existing {@link net.dv8tion.jda.api.entities.SoundboardSound Soundboard sounds} + * Events that track updates for existing {@link net.dv8tion.jda.api.entities.SoundboardSound SoundboardSounds} * *

Requirements
* diff --git a/src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java b/src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java index 87a6dfccd7..f488612bd8 100644 --- a/src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java +++ b/src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java @@ -33,8 +33,8 @@ * .setEmoji(null) * .queue(); * manager.reset(SoundboardSoundManager.VOLUME | SoundboardSoundManager.EMOJI) - * .setVolume("1") - * .setEmoji(Color.RED) + * .setVolume(1) + * .setEmoji(Emoji.fromUnicode("🤔")) * .queue(); * } *