Fix unreachable code not triggering privileged intent error

This commit is contained in:
Maxine 2025-06-20 20:24:55 +02:00 committed by GitHub
parent 7f16a06479
commit 3e48119654
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -517,10 +517,10 @@ class AutoShardedClient(Client):
if item.type == EventType.close: if item.type == EventType.close:
await self.close() await self.close()
if isinstance(item.error, ConnectionClosed): if isinstance(item.error, ConnectionClosed):
if item.error.code != 1000:
raise item.error
if item.error.code == 4014: if item.error.code == 4014:
raise PrivilegedIntentsRequired(item.shard.id) from None raise PrivilegedIntentsRequired(item.shard.id) from None
if item.error.code != 1000:
raise item.error
return return
elif item.type in (EventType.identify, EventType.resume): elif item.type in (EventType.identify, EventType.resume):
await item.shard.reidentify(item.error) await item.shard.reidentify(item.error)