fixed typos & added set_pause to change_node

This commit is contained in:
Crussader 2021-10-27 17:48:00 +04:00 committed by GitHub
parent e211f32c94
commit 81d25e3868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -299,11 +299,13 @@ class Player(VoiceProtocol):
async def change_node(self, node: Node = None) -> None: async def change_node(self, node: Node = None) -> None:
if node := (node or NodePool.get_node()): if node := (node or NodePool.get_node()):
await self.set_pause(True)
del self._node.players[self.guild.id] del self._node.players[self.guild.id]
self._node = node self._node = node
self._node.players[self.guild.id] = self self._node.players[self.guild.id] = self
if self._voice_state: if self._voice_state:
await self._dispatch_voice_update(self._voice_state) await self._dispatch_voice_update(self._voice_state)
await self.set_pause(False)
if self._current: if self._current:
await self._node.send( await self._node.send(
@ -312,7 +314,8 @@ class Player(VoiceProtocol):
track=self.current.track_id, track=self.current.track_id,
startTime=self.position, startTime=self.position,
endTime=self.current.length, endTime=self.current.length,
noReplace = False) noReplace = False
)
self._last_update = time.time() * 1000 self._last_update = time.time() * 1000