S-Soundboawd

This section documents evewything wewated to Discowd soundboawds.

Discowd Modews

PawtiawSoundboawdSound

Attwibutes
Methods
class disnake.PartialSoundboardSound[source]

Wepwesents a pawtiaw s-s-soundboawd sound.

Used fow sounds in VoiceChannelEffects, and as the base fow fuww SoundboardSound/GuildSoundboardSound o-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.

id

The sound’s ID.

Type:

int

volume

The sound’s vowume (fwom 0.0 t-to 1.0).

Type:

float

property created_at[source]

Wetuwns the sound’s c-cweation time in UTC. Can be None if this is a defauwt sound.

T-Type:

Optionyaw[datetime.datetime]

property url[source]

The uww fow the sound f-f-fiwe.

Type:

str

is_default()[source]

Whethew the sound is a defauwt sound pwovided by Discowd.

Wetuwn type:

bool

await read()[source]

This function is a cowoutinye.

Wetwieves the content of this asset as a bytes object.

Waises:
Wetuwns:

The content of the asset.

Wetuwn t-type:

bytes

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:
Wetuwns:

The nyumbew of bytes wwitten.

Wetuwn type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function is a cowoutinye.

Convewts the asset into a File suitabwe fow sending via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • spoiwew (bool) – Whethew the fiwe is a spoiwew.

  • fiwenyame (Optionyaw[str]) – The fiwenyame to dispway when upwoading to Discowd. If this is nyot given, it defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The fiwe’s descwiption.

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:

File

SoundboawdSound

Methods
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.

id

The sound’s ID.

Type:

int

volume

The sound’s vowume (fwom 0.0 to 1.0).

Type:

float

name

The sound’s nyame.

Type:

str

emoji

The sound’s emoji, if any. Due to a D-Discowd wimitation, this wiww have an empty name if it is a custom PartialEmoji.

Type:

Optionyaw[Unyion[Emoji, PartialEmoji]]

available

W-W-Whethew t-this sound is avaiwabwe fow use.

Type:

bool

property created_at[source]

Wetuwns the sound’s cweation time in UTC. Can be None if this is a defauwt sound.

Type:

Optionyaw[datetime.datetime]

is_default()[source]

Whethew the sound is a defauwt sound pwovided by Discowd.

Wetuwn type:

bool

await read()[source]

This function is a cowoutinye.

W-W-Wetwieves the content of this asset as a bytes o-o-object.

Waises:
Wetuwns:

The content of the asset.

Wetuwn type:

bytes

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:
Wetuwns:

The nyumbew of b-bytes wwitten.

Wetuwn t-t-type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function is a cowoutinye.

Convewts the asset into a File suitabwe f-f-fow sending via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • spoiwew (bool) – Whethew the fiwe is a spoiwew.

  • fiwenyame (Optionyaw[str]) – The fiwenyame t-to dispway when upwoading to Discowd. If this is nyot given, i-i-it defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The f-fiwe’s descwiption.

Waises:
Wetuwns:

The asset as a f-fiwe suitabwe fow sending.

Wetuwn t-type:

File

property url[source]

The uww fow the sound fiwe.

Type:

str

GuiwdSoundboawdSound

Methods
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.

id

The sound’s ID.

Type:

int

volume

The sound’s vowume (fwom 0.0 to 1.0).

Type:

float

name

The sound’s nyame.

Type:

str

emoji

The sound’s emoji, if a-a-any. Due to a Discowd wimitation, this wiww have an e-e-empty name if i-i-it is a custom PartialEmoji.

Type:

Optionyaw[Unyion[Emoji, PartialEmoji]]

guild_id

The ID of the guiwd this sound bewongs to.

Type:

int

available

Whethew this sound is avaiwabwe fow use.

Type:

bool

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 the create_guild_expressions ow manage_guild_expressions pewmission.

Type:

Optionyaw[User]

property guild[source]

The guiwd that this sound is fwom.

Type:

Guild

await edit(*, name=..., volume=..., emoji=..., reason=None)[source]

This function is a cowoutinye.

Edits a GuildSoundboardSound fow the guiwd.

You must have manage_guild_expressions pewmission to do this. If this s-sound was cweated by you, create_guild_expressions pewmission 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 (fwom 0.0 to 1.0).

  • emoji (Optionyaw[Unyion[str, Emoji, PartialEmoji]]) – The sound’s nyew e-emoji. Can be None.

  • 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:

GuildSoundboardSound

await delete(*, reason=None)[source]

This function is a cowoutinye.

Dewetes the GuildSoundboardSound fwom the guiwd.

You must have manage_guild_expressions p-p-pewmission to do this. If this sound was cweated by you, create_guild_expressions pewmission 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 None if this is a defauwt sound.

Type:

O-Optionyaw[datetime.datetime]

is_default()[source]

Whethew the sound is a defauwt sound pwovided by Discowd.

Wetuwn type:

bool

await read()[source]

This function is a cowoutinye.

Wetwieves the content of this asset as a bytes object.

Waises:
Wetuwns:

The content of the asset.

Wetuwn type:

bytes

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:
Wetuwns:

The nyumbew of bytes wwitten.

Wetuwn type:

int

await to_file(*, spoiler=False, filename=None, description=None)[source]

This function is a cowoutinye.

Convewts the asset into a File suitabwe fow sending via abc.Messageable.send().

Nyew in vewsion 2.5.

Changed in vewsion 2.6: Waises TypeError instead of InvalidArgument.

Pawametews:
  • spoiwew (bool) – Whethew the fiwe is a spoiwew.

  • fiwenyame (Optionyaw[str]) – The fiwenyame to dispway when upwoading t-t-to D-D-Discowd. If this is nyot given, it defauwts to the nyame of the asset’s UWW.

  • descwiption (Optionyaw[str]) – The fiwe’s descwiption.

Waises:
Wetuwns:

The asset as a f-fiwe suitabwe fow sending.

Wetuwn type:

File

property url[source]

The uww fow the sound fiwe.

Type:

str

Events