From adcd6fd24d69b577925f76ac420bf6a4b25bff11 Mon Sep 17 00:00:00 2001 From: dolfies Date: Mon, 1 Jan 2024 02:32:09 -0500 Subject: [PATCH] Fix edge case in Client.leave_guild() --- discord/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/discord/client.py b/discord/client.py index f54b21085..4a54ee2c0 100644 --- a/discord/client.py +++ b/discord/client.py @@ -1961,7 +1961,6 @@ class Client: HTTPException Leaving the guild failed. """ - lurking = lurking if lurking is not MISSING else MISSING if lurking is MISSING: attr = getattr(guild, 'joined', lurking) if attr is not MISSING: @@ -1969,7 +1968,7 @@ class Client: elif (new_guild := self._connection._get_guild(guild.id)) is not None: lurking = not new_guild.is_joined() - await self.http.leave_guild(guild.id, lurking=lurking) + await self.http.leave_guild(guild.id, lurking=lurking or False) async def fetch_stage_instance(self, channel_id: int, /) -> StageInstance: """|coro|