From 252ac38f9206e412aa7353c0832fe13951f2ce8e Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 5 May 2023 10:55:23 -0400 Subject: [PATCH] Add fallback ClientUser.mutual_guilds property Fixes #9387 --- discord/user.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/discord/user.py b/discord/user.py index 23868712c..1b899883a 100644 --- a/discord/user.py +++ b/discord/user.py @@ -409,6 +409,18 @@ class ClientUser(BaseUser): data: UserPayload = await self._state.http.edit_profile(payload) return ClientUser(state=self._state, data=data) + @property + def mutual_guilds(self) -> List[Guild]: + """List[:class:`Guild`]: The guilds that the user shares with the client. + + .. note:: + + This will only return mutual guilds within the client's internal cache. + + .. versionadded:: 1.7 + """ + return list(self._state.guilds) + class User(BaseUser, discord.abc.Messageable): """Represents a Discord user.