From 3e48119654411d1fbf4dafaae8f06c6a0d053cfd Mon Sep 17 00:00:00 2001 From: Maxine Date: Fri, 20 Jun 2025 20:24:55 +0200 Subject: [PATCH] Fix unreachable code not triggering privileged intent error --- discord/shard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/shard.py b/discord/shard.py index 454fd5e28..cd10cc265 100644 --- a/discord/shard.py +++ b/discord/shard.py @@ -517,10 +517,10 @@ class AutoShardedClient(Client): if item.type == EventType.close: await self.close() if isinstance(item.error, ConnectionClosed): - if item.error.code != 1000: - raise item.error if item.error.code == 4014: raise PrivilegedIntentsRequired(item.shard.id) from None + if item.error.code != 1000: + raise item.error return elif item.type in (EventType.identify, EventType.resume): await item.shard.reidentify(item.error)