Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: soundboard #1112

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

teaishealthy
Copy link
Collaborator

@teaishealthy teaishealthy commented Aug 17, 2023

Summary

Implement soundboard and the Voice Channel Effect Send event. Closes #1047

discord/discord-api-docs#6025
discord/discord-api-docs#6260

id is the same sound_id, just not available sometimes? ¯\_(ツ)_/¯

This is a Code Change

  • I have tested my changes.
  • I have updated the documentation to reflect the changes.
  • I have run task pyright and fixed the relevant issues.

TODO

  • Documentation
  • If we get no REST endpoint for sounds, add a convenience method on Guild that requests sounds and wait_fors the sound data ➞ fetch_soundboard_sounds
  • Sound uploading

Maybe

  • Asset rework into ➞ into SoundAsset and ?Asset

@teaishealthy teaishealthy added t: enhancement Type: enhancement - new feature or request s: in progress Status: the issue or PR is in development/progress p: medium Priority: medium - should be worked on in the near future t: api coverage Type: api coverage - this adds code to cover the discord API s: waiting for discord status: the issue requires changes to the documentation or behaviour before it can be completed. labels Aug 17, 2023
nextcord/soundboard.py Outdated Show resolved Hide resolved
nextcord/soundboard.py Outdated Show resolved Hide resolved
return self._state._upgrade_partial_soundboard_sound(partial)

def __repr__(self) -> str:
return f"<VoiceChannelEffect channel_id={self.channel_id} guild_id={self.guild_id} user_id={self.user_id} emoji={self.emoji} animation_type={self.animation_type} animation_id={self.animation_id} sound_id={self.sound_id} sound_override_path={self.sound_override_path} sound_volume={self.sound_volume}>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all of these attributes be in the repr? It seems excessive.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a temporary thing. I just wanted something for debugging so i didn't have to look at the default repr. I'm going to give it more thought later

nextcord/types/soundboard.py Show resolved Hide resolved
nextcord/voice_channel_effect.py Show resolved Hide resolved
nextcord/soundboard.py Show resolved Hide resolved
nextcord/asset.py Outdated Show resolved Hide resolved
nextcord/asset.py Outdated Show resolved Hide resolved
nextcord/guild.py Outdated Show resolved Hide resolved
nextcord/guild.py Outdated Show resolved Hide resolved
nextcord/soundboard.py Outdated Show resolved Hide resolved
@EmmmaTech EmmmaTech removed the t: enhancement Type: enhancement - new feature or request label Aug 19, 2023
teaishealthy and others added 3 commits August 19, 2023 12:07
Co-Authored-By: EmreTech <50607143+emretech@users.noreply.github.com>
nextcord/guild.py Outdated Show resolved Hide resolved
Comment on lines +30 to +32
sound_id: int,
sound_override_path: Optional[str],
sound_volume: Optional[float],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these parameters prefixed with sound_ when the attributes aren't?

nextcord/types/soundboard.py Outdated Show resolved Hide resolved
nextcord/voice_channel_effect.py Outdated Show resolved Hide resolved
from .types.voice import VoiceChannelEffectSend as VoiceChannelEffectSendPayload


class VoiceChannelEffect:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to add __slots__.

nextcord/soundboard.py Outdated Show resolved Hide resolved
nextcord/http.py Show resolved Hide resolved
nextcord/soundboard.py Outdated Show resolved Hide resolved
teaishealthy and others added 2 commits September 22, 2023 17:50
Co-Authored-By: EmreTech <50607143+emretech@users.noreply.github.com>
@teaishealthy teaishealthy added the 3.0 The issue/PR should go for the 3.0 release label Oct 5, 2023
@teaishealthy
Copy link
Collaborator Author

i will pick this up again soon

@teaishealthy
Copy link
Collaborator Author

i will pick this up again soon

i lied, pr is available to be picked up by someone else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 The issue/PR should go for the 3.0 release p: medium Priority: medium - should be worked on in the near future s: in progress Status: the issue or PR is in development/progress s: waiting for discord status: the issue requires changes to the documentation or behaviour before it can be completed. t: api coverage Type: api coverage - this adds code to cover the discord API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for Discord Soundboard
2 participants