discord.py
discord.py copied to clipboard
Support for Soundboard and VC effects
Summary
Last updated: Aug 15, 2024
- Bots can receive voice channel effects over gateway events
- Bots can receive sounds over gateway events and over API requests
- Bots can create, edit and delete sounds
- Bots can send sounds
This PR includes
-
Support for voice channel effects
-
VoiceChannelEffect
,VoiceChannelSoundEffect
,VoiceChannelEffectAnimation
models -
VoiceChannelEffectAnimationType
enum -
on_voice_channel_effect
event
-
-
Support for soundboard sounds
-
SoundboardSound
,SoundboardDefaultSound
models -
create_
,edit_
,delete_
sound -
fetch_
methods (default sounds, normal sounds, specific sound) - Request sounds over the gateway (may be superfluous since
fetch_
methods exist) -
VoiceChannel.send_sound
method -
soundboard_sounds
property andget_
methods (both forGuild
andClient
) -
on_soundboard_sound_
events (create, update, delete) +GUILD_SOUNDBOARD_SOUNDS_UPDATE
event (dispatchesupdate
event for every sound in the list)
-
- Related Audit Log events
-
Intents.expressions
->emojis
andemojis_and_stickers
are now both aliases
Current Problems [solved]
All problems on Discord's side, which were stated in the related soundboard PR are fixed ✅
- There is no GET route for individual sounds or a guild's list of sounds. Guild sound lists can currently only be retrieved via the Gateway. GET routes should be added *
- PATCHing a sound currently clears the sound's volume and emoji if those aren't included in the request. The PR documents this current behavior, let me know once it is fixed **
- Looks like id and sound_id are always the same, but id is optional ***
* Now available
** The PR doesn't document this behaviour anymore
*** id
has been removed
Others
Default sounds are identified with an id
, override_path
has been removed
Related PRs: https://github.com/discord/discord-api-docs/pull/6025 (voice channel effects), https://github.com/discord/discord-api-docs/pull/6260 (soundboard)
Checklist
Testing pending
- [x] If code changes were made then they have been tested.
- [x] I have updated the documentation to reflect the changes.
- [ ] This PR fixes an issue.
- [x] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is not a code change (e.g. documentation, README, ...)
When can we expect this to be undrafted and merged? @Puncher1
@SvenLie The GET method is still not supported which, at least for me, doesn't make sense to merge it yet.
Update
- For the current status, please refer to the PR description
- The 3.x checks are failing. Looks like there's an error in the installation, @Rapptz
- Testing is pending, after that this PR is ready for review
3.x is failing due to aiohttp not building on 3.12 and 3.x is latest Python, so CI is blocked on dependencies and not much I can do there.
This has been tested and is ready for review now.
I believe the issues with 3.x have been resolved now. 🎉
Alright I'm done with the changes. Because of the name, how about just Sound
? And should it be also applied for properties and attributes (e.g. Client.soundboard_sounds
-> Client.sounds
)?
This will need changes because of the latests commits on the DDevs Docs PR: https://github.com/discord/discord-api-docs/pull/6260/commits/ec8656239280b89c512e92921b1e43717fcaa6c6
... 2. The machinery to handle opcode 31 in the gateway seems very complicated for what it is. The chunking mechanism is the way it is because it's expected that multiple events flow in and it needs to be synced and waited. I have no reason to believe soundboard sounds operate the same way but I also have no idea if they do. I tried asking to get clarification on this though I haven't gotten a response yet. I'll update you when I do.
@Rapptz You can now get soundboard sounds via GET /guilds/{guild_id}/soundboard-sounds
, opcode 31 is now quite superfluous.
Edit Except for receiving sounds for multiple guilds in one request 🤷♂️