From 60edb6f2154279c7618f21f97165832fa6d2667c Mon Sep 17 00:00:00 2001 From: Damego Date: Sat, 24 Jun 2023 21:56:33 +0500 Subject: [PATCH] fix: attribute error for user in messageinteraction(#1459) --- interactions/models/discord/message.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interactions/models/discord/message.py b/interactions/models/discord/message.py index c84d3dfc0..bccc6a36b 100644 --- a/interactions/models/discord/message.py +++ b/interactions/models/discord/message.py @@ -187,9 +187,10 @@ def _process_dict(cls, data: Dict[str, Any], client: "Client") -> Dict[str, Any] data["user_id"] = client.cache.place_user_data(user_data).id return data - async def user(self) -> "models.User": + @property + def user(self) -> "models.User": """Get the user associated with this interaction.""" - return await self.get_user(self._user_id) + return self.client.get_user(self._user_id) @attrs.define(eq=False, order=False, hash=False, kw_only=False)