Skip to content

Commit

Permalink
♻️ Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Oct 25, 2024
1 parent ae4983d commit 8a9ec19
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
11 changes: 6 additions & 5 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"PartialMessageable",
"ForumChannel",
"ForumTag",
# "VoiceChannelEffect",
"VoiceChannelEffectSendEvent",
)

Expand Down Expand Up @@ -3254,6 +3253,11 @@ def get_partial_message(self, message_id: int, /) -> PartialMessage:


class VoiceChannelEffectAnimation(NamedTuple):
"""Represents an animation that can be sent to a voice channel.
.. versionadded:: 2.7
"""

id: int
type: VoiceChannelEffectAnimationType

Expand All @@ -3264,10 +3268,7 @@ class VoiceChannelSoundEffect(PartialSoundboardSound): ...
class VoiceChannelEffectSendEvent:
"""Represents the payload for an :func:`on_voice_channel_effect_send`
.. versionadded:: 2.4
.. versionchanged:: 2.7
Added the `sound` attribute.
.. versionadded:: 2.7
Attributes
----------
Expand Down
2 changes: 1 addition & 1 deletion discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,7 @@ async def delete_emoji(self, emoji: Snowflake) -> None:
def get_sound(self, sound_id: int) -> SoundboardSound | None:
"""Gets a :class:`.Sound` from the bot's sound cache.
.. versionadded:: 2.4
.. versionadded:: 2.7
Parameters
----------
Expand Down
5 changes: 4 additions & 1 deletion discord/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,10 @@ class PollLayoutType(Enum):


class VoiceChannelEffectAnimationType(Enum):
"""Voice channel effect animation type"""
"""Voice channel effect animation type
.. versionadded:: 2.7
"""

premium = 0
basic = 1
Expand Down
4 changes: 3 additions & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def categories(self) -> list[CategoryChannel]:
def sounds(self) -> list[SoundboardSound]:
"""A list of soundboard sounds that belong to this guild.
.. versionadded:: 2.5
.. versionadded:: 2.7
This is sorted by the position and are in UI order from top to bottom.
"""
Expand Down Expand Up @@ -4316,6 +4316,8 @@ def entitlements(
def get_sound(self, sound_id: int):
"""Returns a sound with the given ID.
.. versionadded :: 2.7
Parameters
----------
sound_id: :class:`int`
Expand Down
8 changes: 4 additions & 4 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -3230,7 +3230,7 @@ def get_guild_sound(
)

def edit_guild_sound(
self, guild_id: Snowflake, sound_Id: Snowflake, *, reason: str | None, **payload
self, guild_id: Snowflake, sound_id: Snowflake, *, reason: str | None, **payload
):
keys = (
"name",
Expand All @@ -3246,14 +3246,14 @@ def edit_guild_sound(
"PATCH",
"/guilds/{guild_id}/soundboard-sounds/{sound_id}",
guild_id=guild_id,
sound_id=sound_Id,
sound_id=sound_id,
),
json=payload,
reason=reason,
)

def send_soundboard_sound(
self, chanel_id: int, sound: PartialSoundboardSound
self, channel_id: int, sound: PartialSoundboardSound
) -> None:
payload = {
"sound_id": sound.id,
Expand All @@ -3265,7 +3265,7 @@ def send_soundboard_sound(
Route(
"POST",
"/channels/{channel_id}/send-soundboard-sound",
channel_id=chanel_id,
channel_id=channel_id,
),
json=payload,
)
1 change: 0 additions & 1 deletion discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,6 @@ def create_message(
return Message(state=self, channel=channel, data=data)

def parse_voice_channel_effect_send(self, data) -> None:
__import__("json")
if sound_id := int(data.get("sound_id", 0)):
sound = self._get_sound(sound_id)
if sound is None:
Expand Down

0 comments on commit 8a9ec19

Please sign in to comment.