Skip to content

Commit

Permalink
Last docs
Browse files Browse the repository at this point in the history
  • Loading branch information
freya022 committed Nov 4, 2024
1 parent f9245b4 commit 0fd3723
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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),
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public interface SoundboardSoundManager extends Manager<SoundboardSoundManager>
* Sets the <b><u>emoji</u></b> 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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,29 @@ public interface SoundboardSoundCreateAction extends AuditableRestAction<Soundbo
@CheckReturnValue
SoundboardSoundCreateAction addCheck(@Nonnull BooleanSupplier checks);

/**
* Sets the <b><u>volume</u></b> 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 <b><u>emoji</u></b> 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);
Expand Down

0 comments on commit 0fd3723

Please sign in to comment.