Skip to content

Commit

Permalink
Add checks to manager
Browse files Browse the repository at this point in the history
  • Loading branch information
freya022 committed Oct 17, 2024
1 parent 6dde626 commit 50012d9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.dv8tion.jda.api.managers.SoundboardSoundManager;
import net.dv8tion.jda.api.requests.Route;
import net.dv8tion.jda.api.utils.data.DataObject;
import net.dv8tion.jda.internal.utils.Checks;
import okhttp3.RequestBody;

import javax.annotation.CheckReturnValue;
Expand Down Expand Up @@ -100,6 +101,7 @@ public SoundboardSoundManagerImpl reset()
@Override
public SoundboardSoundManagerImpl setName(@Nonnull String name)
{
Checks.check(name.length() >= 2 && name.length() <= 32, "Name must be between 2 and 32 characters");
this.name = name;
set |= NAME;
return this;
Expand All @@ -109,6 +111,7 @@ public SoundboardSoundManagerImpl setName(@Nonnull String name)
@Override
public SoundboardSoundManagerImpl setVolume(double volume)
{
Checks.check(volume >= 0 && volume <= 1, "Volume must be between 0 and 1");
this.volume = volume;
set |= VOLUME;
return this;
Expand Down

0 comments on commit 50012d9

Please sign in to comment.