fix move to and swap node
This commit is contained in:
parent
5c71e9a562
commit
e7c627dcd2
|
|
@ -349,7 +349,7 @@ class Player(VoiceProtocol):
|
||||||
method="PATCH",
|
method="PATCH",
|
||||||
path=self._player_endpoint_uri,
|
path=self._player_endpoint_uri,
|
||||||
guild_id=self._guild.id,
|
guild_id=self._guild.id,
|
||||||
data=data,
|
data=data or None,
|
||||||
)
|
)
|
||||||
|
|
||||||
self._log.debug(f"Swapped all players to new node {new_node._identifier}.")
|
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}")
|
self._log.debug(f"Player volume has been adjusted to {volume}")
|
||||||
return self._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."""
|
"""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)
|
await self.guild.change_voice_state(channel=channel)
|
||||||
|
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
|
|
||||||
await self._dispatch_voice_update()
|
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:
|
async def add_filter(self, _filter: Filter, fast_apply: bool = False) -> Filters:
|
||||||
"""Adds a filter to the player. Takes a pomice.Filter object.
|
"""Adds a filter to the player. Takes a pomice.Filter object.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue