File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed
Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -2014,6 +2014,25 @@ async def set_status(
20142014 """
20152015 await self ._state .http .set_voice_channel_status (self .id , status , reason = reason )
20162016
2017+ async def send_soundboard_sound (self , sound : PartialSoundboardSound ) -> None :
2018+ """|coro|
2019+
2020+ Sends a soundboard sound to the voice channel.
2021+
2022+ Parameters
2023+ ----------
2024+ sound: :class:`PartialSoundboardSound`
2025+ The soundboard sound to send.
2026+
2027+ Raises
2028+ ------
2029+ Forbidden
2030+ You do not have proper permissions to send the soundboard sound.
2031+ HTTPException
2032+ Sending the soundboard sound failed.
2033+ """
2034+ await self ._state .http .send_soundboard_sound (self .id , sound )
2035+
20172036
20182037class StageChannel (discord .abc .Messageable , VocalGuildChannel ):
20192038 """Represents a Discord guild stage channel.
Original file line number Diff line number Diff line change 4545 NotFound ,
4646)
4747from .gateway import DiscordClientWebSocketResponse
48+ from .soundboard import PartialSoundboardSound , SoundboardSound
4849from .utils import MISSING , warn_deprecated
4950
5051_log = logging .getLogger (__name__ )
5455
5556 from .enums import AuditLogAction , InteractionResponseType
5657 from .file import File
57- from .soundboard import SoundboardSound
5858 from .types import (
5959 appinfo ,
6060 application_role_connection ,
@@ -3251,3 +3251,21 @@ def edit_sound(
32513251 json = payload ,
32523252 reason = reason ,
32533253 )
3254+
3255+ def send_soundboard_sound (
3256+ self , chanel_id : int , sound : PartialSoundboardSound
3257+ ) -> None :
3258+ payload = {
3259+ "sound_id" : sound .id ,
3260+ }
3261+ if isinstance (sound , SoundboardSound ) and not sound .is_default_sound :
3262+ payload ["source_guild_id" ] = sound .guild_id
3263+
3264+ return self .request (
3265+ Route (
3266+ "POST" ,
3267+ "/channels/{channel_id}/send-soundboard-sound" ,
3268+ channel_id = chanel_id ,
3269+ ),
3270+ json = payload ,
3271+ )
You can’t perform that action at this time.
0 commit comments