Soundboard¶
discord_http.soundboard module¶
- class discord_http.soundboard.PartialSoundboardSound(*, state: DiscordAPI, id: int, guild_id: int | None = None)[source]¶
Bases:
PartialBase
- async delete(*, reason: str | None = None) None [source]¶
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
- async edit(*, name: str | MISSING = <MISSING>, volume: int | MISSING = <MISSING>, emoji_name: str | MISSING = <MISSING>, emoji_id: str | MISSING = <MISSING>, icon: File | bytes | MISSING = <MISSING>, reason: str | None = None) SoundboardSound [source]¶
Edit the soundboard sound
- Parameters:
name (Optional[str]) – The new name of the soundboard sound
volume (Optional[int]) – The new volume of the soundboard sound
emoji_name (Optional[str]) – The new unicode emoji of the soundboard sound
emoji_id (Optional[str]) – The ID of the new custom emoji of the soundboard sound
reason (Union[str]) – The reason for editing the soundboard sound
- Returns:
The edited soundboard sound and its data
- Return type:
Union[SoundboardSound, PartialSoundboardSound]
- 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 [source]¶
Returns the soundboard sound data
- Returns:
The soundboard sound data
- Return type:
SoundboardSound
- Raises:
ValueError – Soundboard sound does not belong to a guild
- property guild: Guild | PartialGuild | None¶
Returns the guild this soundboard sound is in
- Returns:
The guild this soundboard sound is in
- Return type:
PartialGuild
- Raises:
ValueError – guild_id is not defined, unable to create PartialGuild
- class discord_http.soundboard.SoundboardSound(*, state: DiscordAPI, data: dict, guild: PartialGuild | Guild | None)[source]¶
Bases:
PartialSoundboardSound