Interface SoundboardSound
- All Superinterfaces:
ISnowflake, SoundboardSoundSnowflake
Represents a soundboard sound, can be used in voice channels if they are
available.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondelete()Deletes this soundboard sound.getEmoji()The emoji of this sound, ornullif none is set.getGuild()The guild this sound is from, ornullif this is a default soundboard sound.getJDA()Returns theJDAinstance related to this SoundboardSound.TheSoundboardSoundManagerfor this soundboard sound, in which you can modify values.getName()The name of this sound.getUser()The user which created this sound, ornullif this is a default soundboard sound.doubleThe volume of this sound, from 0 to 1.booleanWhether this sound can be used, may befalsedue to loss of server boosts.sendTo(ISoundboardSoundChannel channel) Sends this sound to the specified voice channel.Methods inherited from interface ISnowflake
getId, getIdLong, getTimeCreatedMethods inherited from interface SoundboardSoundSnowflake
getUrl
-
Method Details
-
getJDA
-
getName
-
getVolume
double getVolume()The volume of this sound, from 0 to 1.- Returns:
- The volume of this sound, from 0 to 1
-
getEmoji
The emoji of this sound, ornullif none is set.- Returns:
- The emoji of this sound, or
null
-
getGuild
The guild this sound is from, ornullif this is a default soundboard sound.- Returns:
- The guild this sound is from, or
null
-
isAvailable
boolean isAvailable()Whether this sound can be used, may befalsedue to loss of server boosts.- Returns:
trueif the sound can be used,falseotherwise
-
getUser
The user which created this sound, ornullif this is a default soundboard sound.This is present only if the
self memberhas theCREATE_GUILD_EXPRESSIONSorMANAGE_GUILD_EXPRESSIONSpermission.- Returns:
- The user which created this sound, or
null
-
sendTo
Sends this sound to the specified voice channel.
The bot must be connected to the voice channel to use this method, as well as be unmuted and undefeaned.The returned
RestActioncan encounter the followingErrorResponses:MISSING_PERMISSIONS
The sound cannot be sent due to a permission discrepancyCANNOT_SEND_VOICE_EFFECT
The sound cannot be sent as the bot is either muted, deafened or suppressedUNKNOWN_SOUND
The sound was deleted
- Parameters:
channel- The channel to send this sound on- Returns:
RestAction- Type:Void- Throws:
InsufficientPermissionException- If the bot does not have the following permissions:VOICE_SPEAK,VOICE_USE_SOUNDBOARD- When used in other guilds,
VOICE_USE_EXTERNAL_SOUNDSpermission
IllegalArgumentException- If the provided channel isnullIllegalStateException-- If the sound is not
available - If the bot is not connected to the specified channel
- If the bot is deafened, muted or suppressed in the target guild
- If the sound is not
DetachedEntityException- If the provided channel is detached
-
delete
Deletes this soundboard sound.The returned
RestActioncan encounter the followingErrorResponses:MISSING_PERMISSIONS
The sound cannot be deleted due to a permission discrepancyUNKNOWN_SOUND
The sound was deleted
- Returns:
RestAction- Type:Void- Throws:
InsufficientPermissionException-- If the bot does not own this sound and does not have
Permission.MANAGE_GUILD_EXPRESSIONS - If the bot owns this sound and does not have
Permission.MANAGE_GUILD_EXPRESSIONSorPermission.CREATE_GUILD_EXPRESSIONS
- If the bot does not own this sound and does not have
-
getManager
TheSoundboardSoundManagerfor this soundboard sound, in which you can modify values.
You modify multiple fields in one request by chaining setters before callingRestAction.queue().The returned
RestActioncan encounter the followingErrorResponses:MISSING_PERMISSIONS
The sound cannot be edited due to a permission discrepancyINVALID_EMOJI
The emoji is invalidUNKNOWN_SOUND
The sound was deleted
- Returns:
- The SoundboardSoundManager of this soundboard sound
- Throws:
InsufficientPermissionException-- If the bot does not own this sound and does not have
Permission.MANAGE_GUILD_EXPRESSIONS - If the bot owns this sound and does not have
Permission.MANAGE_GUILD_EXPRESSIONSorPermission.CREATE_GUILD_EXPRESSIONS
- If the bot does not own this sound and does not have
-