Soundboard

discord_http.soundboard module

class discord_http.soundboard.PartialSoundboardSound(*, state, id, guild_id=None)

Bases: PartialBase

Represents a partial soundboard sound object.

Parameters:
sound_id: int

The ID of the soundboard sound.

guild_id: int | None

The ID of the guild this soundboard sound is in, if any.

property guild: Guild | PartialGuild | None

Returns the guild this soundboard sound is in.

Return type:

The guild this soundboard sound is in

Raises:

ValueError – guild_id is not defined, unable to create PartialGuild

async fetch() SoundboardSound

Returns the soundboard sound data.

Return type:

SoundboardSound

Returns:

The soundboard sound data

Raises:

ValueError – Soundboard sound does not belong to a guild

async delete(*, reason=None) None

Delete the soundboard sound.

Parameters:

reason (str | None) – The reason for deleting the soundboard sound

Raises:

ValueError – Soundboard sound does not belong to a guild

Return type:

None

async edit(*, name=<MISSING>, volume=<MISSING>, emoji_name=<MISSING>, emoji_id=<MISSING>, icon=<MISSING>, reason=None) SoundboardSound | PartialSoundboardSound

Edit the soundboard sound.

Parameters:
  • name – The new name of the soundboard sound

  • volume – The new volume of the soundboard sound

  • emoji_name – The new unicode emoji of the soundboard sound

  • emoji_id – The ID of the new custom emoji of the soundboard sound

  • icon – The new icon of the soundboard sound

  • reason – The reason for editing the soundboard sound

Returns:

The edited soundboard sound and its data

Raises:

ValueError

  • If both emoji_name and emoji_id are set - If there were no changes applied to the soundboard sound - Soundboard sound does not belong to a guild

Return type:

SoundboardSound | PartialSoundboardSound

property created_at: datetime

The datetime of the snowflake.

id: int

The ID of the snowflake.

class discord_http.soundboard.SoundboardSound(*, state, data, guild)

Bases: PartialSoundboardSound

Represents a soundboard sound object.

Parameters:
name: str

The name of the soundboard sound.

volume: int

The volume of the soundboard sound.

emoji_id: int | None

The ID of the custom emoji used for the soundboard sound, if any.

property created_at: datetime

The datetime of the snowflake.

async delete(*, reason=None) None

Delete the soundboard sound.

Parameters:

reason (str | None) – The reason for deleting the soundboard sound

Raises:

ValueError – Soundboard sound does not belong to a guild

Return type:

None

async edit(*, name=<MISSING>, volume=<MISSING>, emoji_name=<MISSING>, emoji_id=<MISSING>, icon=<MISSING>, reason=None)

Edit the soundboard sound.

Parameters:
  • name – The new name of the soundboard sound

  • volume – The new volume of the soundboard sound

  • emoji_name – The new unicode emoji of the soundboard sound

  • emoji_id – The ID of the new custom emoji of the soundboard sound

  • icon – The new icon of the soundboard sound

  • reason – The reason for editing the soundboard sound

Returns:

The edited soundboard sound and its data

Raises:

ValueError

  • If both emoji_name and emoji_id are set - If there were no changes applied to the soundboard sound - Soundboard sound does not belong to a guild

async fetch() SoundboardSound

Returns the soundboard sound data.

Return type:

SoundboardSound

Returns:

The soundboard sound data

Raises:

ValueError – Soundboard sound does not belong to a guild

property guild: Guild | PartialGuild | None

Returns the guild this soundboard sound is in.

Return type:

The guild this soundboard sound is in

Raises:

ValueError – guild_id is not defined, unable to create PartialGuild

guild_id: int | None

The ID of the guild this soundboard sound is in, if any.

id: int

The ID of the snowflake.

sound_id: int

The ID of the soundboard sound.

emoji_name: int | None

The unicode emoji used for the soundboard sound, if any.

available: bool

Whether the soundboard sound is available for use.