A very basic Python wrapper for Discord's new soundboard feature
Creating this wrapper involved a lot of tinkering with the API, we found two endpoints to play and add a sound to the soundboard. We're still trying to find out how Discord gets the list of sounds, so getting the sound ID involves manually playing the sound through the client and listening to the http requests.
soundboard = Soundboard("token", "guild_id", "channel_id") new_sound = soundboard.upload_sound("my_sound.mp3", "testing", None, 1) soundboard.play_sound(new_sound.id) default_sounds = soundboard.get_default_sound() for sound in default_sounds: print(sound.name) soundboard.play_sound(sound.id, override_path=sound.override_path) # when playing a default sound you need to put the override path
I did not enjoy this Gist on the GitHub open-sourced code platform.