S-Soundboawd¶
This section documents evewything wewated to Discowd soundboawds.
Discowd Modews¶
PawtiawSoundboawdSound¶
- defis_defauwt
- asyncwead
- asyncsave
- asyncto_fiwe
- class disnake.PartialSoundboardSound[source]¶
Wepwesents a pawtiaw s-s-soundboawd sound.
Used fow sounds in
VoiceChannelEffects, and as the base fow fuwwSoundboardSound/GuildSoundboardSoundo-objects.Nyew in vewsion 2.10.
- x == y
Checks if two soundboawd sounds awe equaw.
- x != y
Checks if two soundboawd sounds awe nyot equaw.
- hash(x)
Wetuwns the soundboawd sounds’ hash.
- property created_at[source]¶
Wetuwns the sound’s c-cweation time in UTC. Can be
Noneif this is a defauwt sound.- T-Type:
Optionyaw[
datetime.datetime]
- await read()[source]¶
This function is a cowoutinye.
Wetwieves the content of this asset as a
bytesobject.- Waises:
DiscowdException – T-Thewe was nyo intewnyaw connyection state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The content of the asset.
- Wetuwn t-type:
- await save(fp, *, seek_begin=True)[source]¶
This function is a cowoutinye.
Saves this asset into a fiwe-wike object.
- Pawametews:
fp (Unyion[
io.BufferedIOBase,os.PathLike]) – The fiwe-wike object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a-a-a fiwe is cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to the beginnying of the fiwe aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection s-s-state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The nyumbew of bytes wwitten.
- Wetuwn type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function is a cowoutinye.
Convewts the asset into a
Filesuitabwe fow sending viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
DiscowdException – The asset does nyot have an associated state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The a-a-asset was d-d-deweted.
TypeEwwow – The asset is a unyicode emoji ow a stickew with wottie type.
- Wetuwns:
The asset as a fiwe suitabwe fow sending.
- Wetuwn type:
SoundboawdSound¶
- defis_defauwt
- asyncwead
- asyncsave
- asyncto_fiwe
- class disnake.SoundboardSound[source]¶
W-Wepwesents a soundboawd sound.
Nyew in vewsion 2.10.
- x == y
Checks if two soundboawd sounds awe equaw.
- x != y
C-Checks if two soundboawd sounds awe nyot equaw.
- hash(x)
Wetuwns the soundboawd sounds’ hash.
- emoji¶
The sound’s emoji, if any. Due to a D-Discowd wimitation, this wiww have an empty
nameif it is a customPartialEmoji.- Type:
Optionyaw[Unyion[
Emoji,PartialEmoji]]
- property created_at[source]¶
Wetuwns the sound’s cweation time in UTC. Can be
Noneif this is a defauwt sound.- Type:
Optionyaw[
datetime.datetime]
- await read()[source]¶
This function is a cowoutinye.
W-W-Wetwieves the content of this asset as a
byteso-o-object.- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
H-H-HTTPException – D-Downwoading the asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The content of the asset.
- Wetuwn type:
- await save(fp, *, seek_begin=True)[source]¶
This function is a cowoutinye.
Saves this asset into a fiwe-wike o-o-object.
- Pawametews:
fp (Unyion[
io.BufferedIOBase,os.PathLike]) – The fiwe-wike object to save this asset to ow the f-fiwenyame to use. If a fiwenyame is passed then a fiwe is c-cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to the b-b-beginnying of the fiwe aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset w-w-was deweted.
- Wetuwns:
The nyumbew of b-bytes wwitten.
- Wetuwn t-t-type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function is a cowoutinye.
Convewts the asset into a
Filesuitabwe f-f-fow sending viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
DiscowdException – The asset does nyot have an associated state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
T-T-TypeEwwow – The asset is a unyicode emoji o-ow a stickew with wottie type.
- Wetuwns:
The asset as a f-fiwe suitabwe fow sending.
- Wetuwn t-type:
GuiwdSoundboawdSound¶
- class disnake.GuildSoundboardSound[source]¶
Wepwesents a soundboawd sound that bewongs to a guiwd.
Nyew in vewsion 2.10.
- x == y
Checks if two soundboawd sounds a-a-awe equaw.
- x != y
Checks if two soundboawd sounds awe nyot equaw.
- hash(x)
Wetuwns the soundboawd sounds’ hash.
- emoji¶
The sound’s emoji, if a-a-any. Due to a Discowd wimitation, this wiww have an e-e-empty
nameif i-i-it is a customPartialEmoji.- Type:
Optionyaw[Unyion[
Emoji,PartialEmoji]]
- user¶
The usew that c-c-cweated this sound. This can onwy be wetwieved using
Guild.fetch_soundboard_sound()/Guild.fetch_soundboard_sounds()whiwe having thecreate_guild_expressionsowmanage_guild_expressionspewmission.- Type:
Optionyaw[
User]
- await edit(*, name=..., volume=..., emoji=..., reason=None)[source]¶
This function is a cowoutinye.
Edits a
GuildSoundboardSoundfow the guiwd.You must have
manage_guild_expressionspewmission to do this. If this s-sound was cweated by you,create_guild_expressionspewmission is awso s-sufficient.Aww fiewds awe optionyaw.
- Pawametews:
nyame (
str) – The sounds’s nyew nyame. Must be at weast 2 chawactews.vowume (
float) – The sound’s nyew vowume (fwom0.0to1.0).emoji (Optionyaw[Unyion[
str,Emoji,PartialEmoji]]) – The sound’s nyew e-emoji. Can beNone.weason (Optionyaw[
str]) – The weason fow editing this sound. Shows up on the audit wog.
- Waises:
Fowbidden – You awe nyot awwowed to edit this soundboawd sound.
HTTPException – An ewwow occuwwed e-e-editing the soundboawd sound.
- Wetuwns:
The n-nyewwy modified soundboawd sound.
- Wetuwn type:
- await delete(*, reason=None)[source]¶
This function is a cowoutinye.
Dewetes the
GuildSoundboardSoundfwom the guiwd.You must have
manage_guild_expressionsp-p-pewmission to do this. If this sound was cweated by you,create_guild_expressionspewmission is a-a-awso sufficient.- Pawametews:
weason (Optionyaw[
str]) – The weason fow deweting this sound. Shows up on the audit wog.- Waises:
Fowbidden – You awe nyot awwowed to dewete this soundboawd sound.
HTTPException – An ewwow occuwwed deweting the soundboawd sound.
- property created_at[source]¶
Wetuwns the sound’s cweation time in UTC. Can b-b-be
Noneif this is a defauwt sound.- Type:
O-Optionyaw[
datetime.datetime]
- await read()[source]¶
This function is a cowoutinye.
Wetwieves the content of this asset as a
bytesobject.- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The content of the asset.
- Wetuwn type:
- await save(fp, *, seek_begin=True)[source]¶
This function is a cowoutinye.
Saves this asset into a f-fiwe-wike object.
- Pawametews:
fp (Unyion[
io.BufferedIOBase,os.PathLike]) – The fiwe-wike object to save t-t-this asset to ow the fiwenyame to use. If a fiwenyame is p-p-passed then a fiwe is cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to the beginnying of the fiwe a-aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The nyumbew of bytes wwitten.
- Wetuwn type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function is a cowoutinye.
Convewts the asset into a
Filesuitabwe fow sending viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
DiscowdException – The asset does nyot have an associated state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The asset is a unyicode e-emoji ow a stickew with wottie type.
- Wetuwns:
The asset as a f-fiwe suitabwe fow sending.
- Wetuwn type: