Skip to content

Commit

Permalink
fix(node): stringify bool query params for replace
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed Feb 7, 2023
1 parent bd34f32 commit 63b7462
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions mafic/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,7 @@ def voice_update(
"""

_log.debug(
"Sending player update to lavalink with data %s.",
data,
"Sending player update to lavalink.",
extra={"label": self._label, "guild": guild_id},
)
if data["endpoint"] is None:
Expand Down Expand Up @@ -775,7 +774,7 @@ def update(
data["filters"] = filter.payload

if no_replace is not None:
query: UpdatePlayerParams | None = {"noReplace": no_replace}
query: UpdatePlayerParams | None = {"noReplace": str(no_replace)}
else:
query = None

Expand Down Expand Up @@ -829,13 +828,21 @@ async def __request(
session = self.__session
uri = self._rest_uri / path

_log.debug(
"Sending %s request to %s and data %s.",
method,
uri,
json,
extra={"label": self._label},
)
async with session.request(
method,
uri,
json=json,
params=params,
headers={"Authorization": self.__password},
) as resp:
_log.debug("Received status %s from lavalink.", resp.status)
if not (200 <= resp.status < 300):
text = await resp.text()

Expand Down
2 changes: 1 addition & 1 deletion mafic/typings/outgoing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class UnmarkAddressPayload(TypedDict):


class UpdatePlayerParams(TypedDict):
noReplace: bool
noReplace: str


class TrackLoadParams(TypedDict):
Expand Down

0 comments on commit 63b7462

Please sign in to comment.