From 58537c571acf6748cc000ff548599741b56f8eeb Mon Sep 17 00:00:00 2001 From: dolfies Date: Tue, 26 Dec 2023 21:55:26 -0500 Subject: [PATCH] Prevent flatten_user from copying cached slot properties --- discord/member.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/member.py b/discord/member.py index 2378cb970..cc875390f 100644 --- a/discord/member.py +++ b/discord/member.py @@ -189,7 +189,7 @@ def flatten_user(cls: T) -> T: # If it's a slotted attribute or a property, redirect it # Slotted members are implemented as member_descriptors in Type.__dict__ - if not hasattr(value, '__annotations__'): + if not hasattr(value, '__annotations__') or isinstance(value, utils.CachedSlotProperty): getter = attrgetter('_user.' + attr) setattr(cls, attr, property(getter, doc=f'Equivalent to :attr:`User.{attr}`')) else: