From 0fd3723512e7054a5dfd6075080fe3efc93c1c54 Mon Sep 17 00:00:00 2001 From: freya02 <41875020+freya022@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:42:06 +0200 Subject: [PATCH] Last docs --- .../entities/channel/VoiceChannelEffect.java | 52 +++++++++++++++++++ .../channel/VoiceChannelEffectSendEvent.java | 10 ++++ .../api/managers/SoundboardSoundManager.java | 2 +- .../SoundboardSoundCreateAction.java | 19 +++++++ 4 files changed, 82 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/dv8tion/jda/api/entities/channel/VoiceChannelEffect.java b/src/main/java/net/dv8tion/jda/api/entities/channel/VoiceChannelEffect.java index 87983c57ac..9071497f81 100644 --- a/src/main/java/net/dv8tion/jda/api/entities/channel/VoiceChannelEffect.java +++ b/src/main/java/net/dv8tion/jda/api/entities/channel/VoiceChannelEffect.java @@ -9,6 +9,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +/** + * Represents an emoji effect or a soundboard sound effect. + */ public class VoiceChannelEffect { private final VoiceChannel channel; @@ -26,36 +29,64 @@ public VoiceChannelEffect(VoiceChannel channel, User user, EmojiUnion emoji, Ani this.soundboardSound = soundboardSound; } + /** + * The voice channel this effect was sent to. + * + * @return The voice channel this effect was sent to. + */ @Nonnull public VoiceChannel getChannel() { return channel; } + /** + * The user which sent this effect. + * + * @return The user which sent this effect. + */ @Nonnull public User getUser() { return user; } + /** + * The emoji sent with the effect, this is only present for emoji effects. + * + * @return The emoji sent with the effect, or {@code null} + */ @Nullable public EmojiUnion getEmoji() { return emoji; } + /** + * The animation of the emoji, this is only present for emoji effects. + * + * @return The animation of the emoji, or {@code null} + */ @Nullable public Animation getAnimation() { return animation; } + /** + * The soundboard sound sent with the effect, this is only present for soundboard sound effects. + * + * @return The soundboard sound sent with the effect, or {@code null} + */ @Nullable public SoundboardSound getSoundboardSound() { return soundboardSound; } + /** + * Represents the animation used in emoji effects. + */ public static class Animation implements ISnowflake { public Animation(long id, Animation.Type type) @@ -73,12 +104,20 @@ public long getIdLong() return id; } + /** + * The type of animation + * + * @return The type of animation + */ @Nonnull public Animation.Type getType() { return type; } + /** + * Represents the animation type used in emoji effects. + */ public enum Type { UNKNOWN(-1), @@ -92,11 +131,24 @@ public enum Type this.value = value; } + /** + * The raw value of this animation type. + * + * @return The raw value + */ public int getValue() { return value; } + /** + * Retrieves the animation type from the raw value. + * + * @param value + * The raw value of the animation type + * + * @return The animation type, or {@link #UNKNOWN} for invalid values + */ @Nonnull public static Animation.Type fromValue(int value) { diff --git a/src/main/java/net/dv8tion/jda/api/events/channel/VoiceChannelEffectSendEvent.java b/src/main/java/net/dv8tion/jda/api/events/channel/VoiceChannelEffectSendEvent.java index afc59da61b..b68372c6b1 100644 --- a/src/main/java/net/dv8tion/jda/api/events/channel/VoiceChannelEffectSendEvent.java +++ b/src/main/java/net/dv8tion/jda/api/events/channel/VoiceChannelEffectSendEvent.java @@ -39,12 +39,22 @@ public VoiceChannelEffectSendEvent(@Nonnull JDA api, long responseNumber, VoiceC this.effect = effect; } + /** + * The voice channel the effect was sent to. + * + * @return The voice channel the effect was sent to. + */ @Nonnull public VoiceChannel getVoiceChannel() { return effect.getChannel(); } + /** + * The effect that was sent. + * + * @return The effect that was sent. + */ @Nonnull public VoiceChannelEffect getEffect() { 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 f488612bd8..0382e085ae 100644 --- a/src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java +++ b/src/main/java/net/dv8tion/jda/api/managers/SoundboardSoundManager.java @@ -144,7 +144,7 @@ public interface SoundboardSoundManager extends Manager * Sets the emoji of the selected {@link SoundboardSound}. * * @param emoji - * The new emoji for the selected {@link SoundboardSound} + * The new emoji for the selected {@link SoundboardSound}, can be {@code null} * * @return SoundboardSoundManager for chaining convenience */ diff --git a/src/main/java/net/dv8tion/jda/api/requests/restaction/SoundboardSoundCreateAction.java b/src/main/java/net/dv8tion/jda/api/requests/restaction/SoundboardSoundCreateAction.java index d27f8c520e..235ccdff14 100644 --- a/src/main/java/net/dv8tion/jda/api/requests/restaction/SoundboardSoundCreateAction.java +++ b/src/main/java/net/dv8tion/jda/api/requests/restaction/SoundboardSoundCreateAction.java @@ -51,10 +51,29 @@ public interface SoundboardSoundCreateAction extends AuditableRestActionvolume of the soundboard sound being created. + * + * @param volume + * The new volume + * + * @throws IllegalArgumentException + * If the provided volume is not between 0-1 + * + * @return This action for chaining convenience + */ @Nonnull @CheckReturnValue SoundboardSoundCreateAction setVolume(double volume); + /** + * Sets the emoji of the soundboard sound being created. + * + * @param emoji + * The new emoji, can be {@code null} + * + * @return This action for chaining convenience + */ @Nonnull @CheckReturnValue SoundboardSoundCreateAction setEmoji(@Nullable Emoji emoji);