Merge pull request #58 from NiceAesth/fix-resume

fix: undefined data in `_configure_resuming`
This commit is contained in:
Clxud 2023-08-23 13:14:56 -04:00 committed by GitHub
commit 7617ecf2d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -329,14 +329,16 @@ class Node:
await self.disconnect() await self.disconnect()
async def _configure_resuming(self) -> None: async def _configure_resuming(self) -> None:
if self._resume_key and self._version.major == 3: if not self._resume_key:
data = {"resumingKey": self._resume_key, "timeout": self._resume_timeout} return
elif self._resume_key and self._version.major == 4:
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.") self._log.warning("Using a resume key with Lavalink v4 is deprecated.")
data = { data["resuming"] = True
"resuming": True if self._resume_key else False,
"timeout": self._resume_timeout,
}
await self.send( await self.send(
method="PATCH", method="PATCH",