diff --git a/disnake/member.py b/disnake/member.py index 149fc97ecc..7d7bff178e 100644 --- a/disnake/member.py +++ b/disnake/member.py @@ -385,11 +385,15 @@ def _update_from_message(self, data: MemberPayload) -> None: @classmethod def _try_upgrade( - cls, *, data: UserWithMemberPayload, guild: Guild, state: ConnectionState + cls, + *, + data: Union[UserPayload, UserWithMemberPayload], + guild: Guild, + state: ConnectionState, ) -> Union[User, Self]: # A User object with a 'member' key try: - member_data = data.pop("member") + member_data = data.pop("member") # type: ignore except KeyError: return state.create_user(data) else: diff --git a/disnake/message.py b/disnake/message.py index 7e17ceee9b..6e90a00ee8 100644 --- a/disnake/message.py +++ b/disnake/message.py @@ -1286,7 +1286,9 @@ def _handle_member(self, member: MemberPayload) -> None: # TODO: consider adding to cache here self.author = Member._from_message(message=self, data=member) - def _handle_mentions(self, mentions: List[UserWithMemberPayload]) -> None: + def _handle_mentions( + self, mentions: Union[List[UserPayload], List[UserWithMemberPayload]] + ) -> None: self.mentions = r = [] guild = self.guild state = self._state