From e7c627dcd2507c7d7185082234875a348829fada Mon Sep 17 00:00:00 2001 From: cloudwithax Date: Thu, 6 Apr 2023 20:27:59 -0400 Subject: [PATCH] fix move to and swap node --- pomice/player.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pomice/player.py b/pomice/player.py index 92aeb84..d73ea60 100644 --- a/pomice/player.py +++ b/pomice/player.py @@ -349,7 +349,7 @@ class Player(VoiceProtocol): method="PATCH", path=self._player_endpoint_uri, guild_id=self._guild.id, - data=data, + data=data or None, ) self._log.debug(f"Swapped all players to new node {new_node._identifier}.") @@ -574,23 +574,14 @@ class Player(VoiceProtocol): self._log.debug(f"Player volume has been adjusted to {volume}") return self._volume - async def move_to(self, *, channel: VoiceChannel) -> None: + async def move_to(self, channel: VoiceChannel) -> None: """Moves the player to a new voice channel.""" - if self.current: - data: dict = {"position": self.position, "encodedTrack": self.current.track_id} - await self.guild.change_voice_state(channel=channel) self.channel = channel await self._dispatch_voice_update() - await self._node.send( - method="PATCH", - path=self._player_endpoint_uri, - guild_id=self._guild.id, - data=data, - ) async def add_filter(self, _filter: Filter, fast_apply: bool = False) -> Filters: """Adds a filter to the player. Takes a pomice.Filter object.