updated NodePool.get_node()

This commit is contained in:
Crussader 2021-10-27 21:27:02 +04:00 committed by GitHub
parent cc2b00be95
commit 901b4781d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ from .exceptions import TrackInvalidPosition
from .filters import Filter from .filters import Filter
from .objects import Track from .objects import Track
from .pool import Node, NodePool from .pool import Node, NodePool
from .utils import ClientType, if_toggled from .utils import ClientType, NodeAlgorithims
class Player(VoiceProtocol): class Player(VoiceProtocol):
@ -298,7 +298,7 @@ class Player(VoiceProtocol):
@if_toggled('auto_switch_nodes') @if_toggled('auto_switch_nodes')
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(algorithim=NodeAlgorithims.best_nodes, ping_wise=True)):
await self._node.send(op="destroy", guildId = str(self._guild.id)) await self._node.send(op="destroy", guildId = str(self._guild.id))
del self._node.players[self.guild.id] del self._node.players[self.guild.id]