Skip to content

Commit 2357647

Browse files
committed
Improve docs
1 parent cda847b commit 2357647

File tree

5 files changed

+64
-15
lines changed

5 files changed

+64
-15
lines changed

src/main/java/net/dv8tion/jda/api/JDA.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ default RestAction<ApplicationEmoji> retrieveApplicationEmojiById(long emojiId)
18461846
RestAction<@Unmodifiable List<StickerPack>> retrieveNitroStickerPacks();
18471847

18481848
/**
1849-
* Retrieves a list of the default {@link SoundboardSound soundboard sounds}.
1849+
* Retrieves a list of the default {@link SoundboardSound SoundboardSounds}.
18501850
*
18511851
* @return {@link RestAction} - Type: List of {@link SoundboardSound}
18521852
*/

src/main/java/net/dv8tion/jda/api/entities/Guild.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,10 +2102,10 @@ default SoundboardSound getSoundboardSoundById(long id)
21022102
*
21032103
* <p>This copies the backing store into a list. This means every call
21042104
* creates a new list with O(n) complexity. It is recommended to store this into
2105-
* a local variable or use {@link #getStickerCache()} and use its more efficient
2105+
* a local variable or use {@link #getSoundboardSoundCache()} and use its more efficient
21062106
* versions of handling these values.
21072107
*
2108-
* <p>This requires the {@link CacheFlag#STICKER} to be enabled!
2108+
* <p>This requires the {@link CacheFlag#SOUNDBOARD_SOUNDS} to be enabled!
21092109
*
21102110
* @return An immutable List of {@link SoundboardSound SoundboardSounds}.
21112111
*/
@@ -2128,7 +2128,7 @@ default List<SoundboardSound> getSoundboardSounds()
21282128
* @param ignoreCase
21292129
* Determines if the comparison ignores case when comparing. True - case insensitive.
21302130
*
2131-
* @return Possibly-empty immutable list of all Soundboard sounds that match the provided name.
2131+
* @return Possibly-empty immutable list of all SoundboardSounds that match the provided name.
21322132
*/
21332133
@Nonnull
21342134
@Unmodifiable
@@ -5112,7 +5112,7 @@ default AuditableRestAction<GuildSticker> createSticker(@Nonnull String name, @N
51125112
/**
51135113
* Creates a soundboard sound in the guild.
51145114
*
5115-
* <p>The returned {@link RestAction} can encounter the following Discord errors:
5115+
* <p>The returned {@link RestAction} can encounter the following {@link net.dv8tion.jda.api.requests.ErrorResponse ErrorResponses}:
51165116
* <ul>
51175117
* <li>{@link net.dv8tion.jda.api.requests.ErrorResponse#INVALID_FILE_EXCEEDS_MAXIMUM_LENGTH INVALID_FILE_EXCEEDS_MAXIMUM_LENGTH}
51185118
* <br>The provided file exceeds the duration of 5.2 seconds</li>
@@ -5126,11 +5126,17 @@ default AuditableRestAction<GuildSticker> createSticker(@Nonnull String name, @N
51265126
* <br>The file is malformed</li>
51275127
* </ul>
51285128
*
5129+
* @param name
5130+
* The name of the soundboard sound, must be between 2-32 characters
51295131
* @param file
51305132
* The file to use as the sound, can be an MP3 or an OGG file
51315133
*
51325134
* @throws IllegalArgumentException
5133-
* If {@code null} is provided, or {@code name} is not between 2-32 characters
5135+
* <ul>
5136+
* <li>If {@code null} is provided</li>
5137+
* <li>If {@code name} is not between 2-32 characters</li>
5138+
* <li>If the file is not of the correct type</li>
5139+
* </ul>
51345140
* @throws net.dv8tion.jda.api.exceptions.InsufficientPermissionException
51355141
* If the currently logged in account does not have {@link Permission#CREATE_GUILD_EXPRESSIONS CREATE_GUILD_EXPRESSIONS} in the guild.
51365142
*

src/main/java/net/dv8tion/jda/api/entities/SoundboardSound.java

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ default String getUrl()
102102
/**
103103
* The user which created this sound.
104104
*
105-
* <p>This is present only if the {@link Guild#getSelfMember() current member} has
105+
* <p>This is present only if the {@link Guild#getSelfMember() self member} has
106106
* the {@link Permission#CREATE_GUILD_EXPRESSIONS CREATE_GUILD_EXPRESSIONS}
107107
* or {@link Permission#MANAGE_GUILD_EXPRESSIONS MANAGE_GUILD_EXPRESSIONS} permission.
108108
*
@@ -116,27 +116,31 @@ default String getUrl()
116116
* <br>You must be connected to the voice channel to use this method,
117117
* as well as be able to speak and hear.
118118
*
119-
* <p>Possible {@link ErrorResponse ErrorResponses} caused by
120-
* the returned {@link RestAction} include the following:
119+
* <p>The returned {@link RestAction} can encounter the following {@link ErrorResponse ErrorResponses}:
121120
* <ul>
122121
* <li>{@link ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
123122
* <br>The sound cannot be sent due to a permission discrepancy</li>
124123
* <li>{@link ErrorResponse#CANNOT_SEND_VOICE_EFFECT CANNOT_SEND_VOICE_EFFECT}
125124
* <br>The sound cannot be sent as the bot is either muted, deafened or suppressed</li>
125+
* <li>{@link ErrorResponse#UNKNOWN_SOUND UNKNOWN_SOUND}
126+
* <br>The sound was deleted</li>
126127
* </ul>
127128
*
128129
* @param channel
129130
* The channel to send this sound on
130131
*
131132
* @throws InsufficientPermissionException
132-
* If the logged in account does not have the {@link Permission#VOICE_SPEAK VOICE_SPEAK},
133-
* {@link Permission#VOICE_USE_SOUNDBOARD VOICE_USE_SOUNDBOARD},
134-
* or {@link Permission#VOICE_USE_EXTERNAL_SOUNDS VOICE_USE_EXTERNAL_SOUNDS} permission.
133+
* If the bot does not have the following permissions:
134+
* <ul>
135+
* <li>{@link Permission#VOICE_SPEAK VOICE_SPEAK}, {@link Permission#VOICE_USE_SOUNDBOARD VOICE_USE_SOUNDBOARD}</li>
136+
* <li>When used in other guilds, {@link Permission#VOICE_USE_EXTERNAL_SOUNDS VOICE_USE_EXTERNAL_SOUNDS} permission</li>
137+
* </ul>
135138
* @throws IllegalArgumentException
136139
* If the provided channel is {@code null}
137140
* @throws IllegalStateException
138141
* <ul>
139142
* <li>If {@link GatewayIntent#GUILD_VOICE_STATES} is not enabled</li>
143+
* <li>If the sound is not {@link #isAvailable() available}</li>
140144
* <li>If the bot is not connected to the specified channel</li>
141145
* <li>If the bot is deafened, muted or suppressed in the target guild</li>
142146
* </ul>
@@ -147,10 +151,49 @@ default String getUrl()
147151
@CheckReturnValue
148152
RestAction<Void> sendTo(VoiceChannel channel);
149153

154+
/**
155+
* Deletes this soundboard sound.
156+
*
157+
* <p>The returned {@link RestAction} can encounter the following {@link ErrorResponse ErrorResponses}:
158+
* <ul>
159+
* <li>{@link ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
160+
* <br>The sound cannot be deleted due to a permission discrepancy</li>
161+
* <li>{@link ErrorResponse#UNKNOWN_SOUND UNKNOWN_SOUND}
162+
* <br>The sound was deleted</li>
163+
* </ul>
164+
*
165+
* @throws InsufficientPermissionException
166+
* <ul>
167+
* <li>If the bot does not own this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS}</li>
168+
* <li>If the bot owns this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS} or {@link Permission#CREATE_GUILD_EXPRESSIONS}</li>
169+
* </ul>
170+
*
171+
* @return {@link RestAction} - Type: {@link Void}
172+
*/
150173
@Nonnull
151174
@CheckReturnValue
152175
RestAction<Void> delete();
153176

177+
/**
178+
* The {@link SoundboardSoundManager} for this soundboard sound, in which you can modify values.
179+
* <br>You modify multiple fields in one request by chaining setters before calling {@link RestAction#queue()}.
180+
*
181+
* <p>The returned {@link RestAction} can encounter the following {@link ErrorResponse ErrorResponses}:
182+
* <ul>
183+
* <li>{@link ErrorResponse#MISSING_PERMISSIONS MISSING_PERMISSIONS}
184+
* <br>The sound cannot be edited due to a permission discrepancy</li>
185+
* <li>{@link ErrorResponse#UNKNOWN_SOUND UNKNOWN_SOUND}
186+
* <br>The sound was deleted</li>
187+
* </ul>
188+
*
189+
* @throws InsufficientPermissionException
190+
* <ul>
191+
* <li>If the bot does not own this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS}</li>
192+
* <li>If the bot owns this sound and does not have {@link Permission#MANAGE_GUILD_EXPRESSIONS} or {@link Permission#CREATE_GUILD_EXPRESSIONS}</li>
193+
* </ul>
194+
*
195+
* @return The SoundboardSoundManager of this soundboard sound
196+
*/
154197
@Nonnull
155198
@CheckReturnValue
156199
SoundboardSoundManager getManager();

src/main/java/net/dv8tion/jda/api/events/soundboard/update/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
/**
18-
* Events that track updates for existing {@link net.dv8tion.jda.api.entities.SoundboardSound Soundboard sounds}
18+
* Events that track updates for existing {@link net.dv8tion.jda.api.entities.SoundboardSound SoundboardSounds}
1919
*
2020
* <p><b>Requirements</b><br>
2121
*

src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
* .setEmoji(null)
3434
* .queue();
3535
* manager.reset(SoundboardSoundManager.VOLUME | SoundboardSoundManager.EMOJI)
36-
* .setVolume("1")
37-
* .setEmoji(Color.RED)
36+
* .setVolume(1)
37+
* .setEmoji(Emoji.fromUnicode("🤔"))
3838
* .queue();
3939
* }</pre>
4040
*

0 commit comments

Comments
 (0)