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(
2014
2014
"""
2015
2015
await self ._state .http .set_voice_channel_status (self .id , status , reason = reason )
2016
2016
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
+
2017
2036
2018
2037
class StageChannel (discord .abc .Messageable , VocalGuildChannel ):
2019
2038
"""Represents a Discord guild stage channel.
Original file line number Diff line number Diff line change 45
45
NotFound ,
46
46
)
47
47
from .gateway import DiscordClientWebSocketResponse
48
+ from .soundboard import PartialSoundboardSound , SoundboardSound
48
49
from .utils import MISSING , warn_deprecated
49
50
50
51
_log = logging .getLogger (__name__ )
54
55
55
56
from .enums import AuditLogAction , InteractionResponseType
56
57
from .file import File
57
- from .soundboard import SoundboardSound
58
58
from .types import (
59
59
appinfo ,
60
60
application_role_connection ,
@@ -3251,3 +3251,21 @@ def edit_sound(
3251
3251
json = payload ,
3252
3252
reason = reason ,
3253
3253
)
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