diff --git a/redbot/cogs/audio/core/events/lavalink.py b/redbot/cogs/audio/core/events/lavalink.py index ab0688bef5d..88582129faa 100644 --- a/redbot/cogs/audio/core/events/lavalink.py +++ b/redbot/cogs/audio/core/events/lavalink.py @@ -311,7 +311,7 @@ async def lavalink_event_handler( colour=await self.bot.get_embed_color(message_channel), title=_("Track Stuck"), description=_( - "Playback of the song has stopped due to an unexpected error.\n{error}" + "Playback of the song was unable to continue.\n{error}" ).format(error=description), ) else: diff --git a/redbot/cogs/audio/core/tasks/lavalink.py b/redbot/cogs/audio/core/tasks/lavalink.py index d3c96103082..890d5c83d23 100644 --- a/redbot/cogs/audio/core/tasks/lavalink.py +++ b/redbot/cogs/audio/core/tasks/lavalink.py @@ -45,6 +45,7 @@ async def lavalink_attempt_connect(self, timeout: int = 50, manual: bool = False await self.managed_node_controller.shutdown() await asyncio.sleep(5) await lavalink.close(self.bot) + is_managed = False while retry_count < max_retries: configs = await self.config.all() external = configs["use_external_lavalink"] @@ -62,6 +63,7 @@ async def lavalink_attempt_connect(self, timeout: int = 50, manual: bool = False # timeout is the same as ServerManager.timeout - # 60s in case of ServerManager(self.config, timeout=60) await self.managed_node_controller.wait_until_ready() + is_managed = True except asyncio.TimeoutError: if self.managed_node_controller is not None: await self.managed_node_controller.shutdown() @@ -110,6 +112,7 @@ async def lavalink_attempt_connect(self, timeout: int = 50, manual: bool = False timeout=timeout, resume_key=f"Red-Core-Audio-{self.bot.user.id}-{data_manager.instance_name}", secured=secured, + is_managed=is_managed, ) except lavalink.AbortingNodeConnection: await lavalink.close(self.bot) diff --git a/redbot/cogs/audio/manager.py b/redbot/cogs/audio/manager.py index 1e767c3fb59..a9fe75eec4e 100644 --- a/redbot/cogs/audio/manager.py +++ b/redbot/cogs/audio/manager.py @@ -458,8 +458,11 @@ async def start_monitor(self, java_path: str): if not psutil.pid_exists(self._node_pid): raise NoProcessFound try: - node = lavalink.get_all_nodes()[0] - if node.ready: + lavalink.get_all_nodes()[0] + node = next( + (node for node in lavalink.get_all_nodes() if node.is_managed), None + ) + if node and node.ready: # Hoping this throws an exception which will then trigger a restart await node._ws.ping() backoff = ExponentialBackoff( diff --git a/setup.cfg b/setup.cfg index 9358063142c..91fe0d4743c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,7 +66,7 @@ install_requires = pytz==2021.1 PyYAML==5.4.1 Red-Commons==1.0.0 - Red-Lavalink==0.11.0rc0 + Red-Lavalink @ git+https://github.com/Cog-Creators/Red-Lavalink@refs/pull/118/merge#egg=Red-Lavalink rich==10.9.0 schema==0.7.4 six==1.16.0