From 1acc5944676c5b08b3cada8a1d81e685976967a7 Mon Sep 17 00:00:00 2001 From: NiceAesth Date: Wed, 23 Aug 2023 20:00:36 +0300 Subject: [PATCH] fix: undefined data in `_configure_resuming` --- pomice/pool.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pomice/pool.py b/pomice/pool.py index 8476456..55a2706 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -329,14 +329,16 @@ class Node: await self.disconnect() async def _configure_resuming(self) -> None: - if self._resume_key and self._version.major == 3: - data = {"resumingKey": self._resume_key, "timeout": self._resume_timeout} - elif self._resume_key and self._version.major == 4: + if not self._resume_key: + return + + data = {"timeout": self._resume_timeout} + + if self._version.major == 3: + data["resumingKey"] = self._resume_key + elif self._version.major == 4: self._log.warning("Using a resume key with Lavalink v4 is deprecated.") - data = { - "resuming": True if self._resume_key else False, - "timeout": self._resume_timeout, - } + data["resuming"] = True await self.send( method="PATCH",