Merge pull request #58 from NiceAesth/fix-resume
fix: undefined data in `_configure_resuming`
This commit is contained in:
commit
7617ecf2d1
|
|
@ -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",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue