diff --git a/setup.py b/setup.py index 0602a5cc..bcebf2a2 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ requirements.append('sphinxcontrib-websupport') requirements.append('Pygments') -version = '0.3.0' +version = '0.3.01' readme = '' with open('README.rst') as f: diff --git a/wavelink/__init__.py b/wavelink/__init__.py index cfabefb6..7a2292b6 100644 --- a/wavelink/__init__.py +++ b/wavelink/__init__.py @@ -2,7 +2,7 @@ __author__ = 'EvieePy' __license__ = 'MIT' __copyright__ = 'Copyright 2019 (c) EvieePy' -__version__ = '0.3.0' +__version__ = '0.3.01' from .client import Client from .errors import * diff --git a/wavelink/client.py b/wavelink/client.py index 03ad8e2f..9571a68c 100644 --- a/wavelink/client.py +++ b/wavelink/client.py @@ -247,7 +247,8 @@ def get_player(self, guild_id: int, *, cls=None, node_id=None) -> Player: if node.region.lower() == str(guild.region).lower(): region_options.append(node) - if not shard_options or region_options: + if not shard_options and not region_options: + # Sort by len of node players node = sorted(nodes, key=lambda n: len(n.players))[0] player = cls(self.bot, guild_id, node) node.players[guild_id] = player @@ -256,7 +257,7 @@ def get_player(self, guild_id: int, *, cls=None, node_id=None) -> Player: best = [n for n in shard_options if n in region_options] if best: - node = sorted(best, key=lambda _: len(_.players))[0] + node = sorted(best, key=lambda n: len(n.players))[0] elif shard_options: node = sorted(shard_options, key=lambda n: len(n.players))[0] else: