diff --git a/CHANGELOG.md b/CHANGELOG.md index 80929555d6..c0be148b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,8 @@ These changes are available on the `master` branch, but have not yet been releas `SortOrder`. ([#2500](https://github.com/Pycord-Development/pycord/pull/2500)) - Fixed `PartialMessage`s causing errors when created from `PartialMessageable`. ([#2568](https://github.com/Pycord-Development/pycord/pull/2500)) +- Fixed the `guild` attribute of `Member`s recieved from a `UserCommand` being `None`. + ([#2573](https://github.com/Pycord-Development/pycord/pull/2573)) ## [2.6.0] - 2024-07-09 diff --git a/discord/commands/core.py b/discord/commands/core.py index 9212e76bed..6dd1b0d636 100644 --- a/discord/commands/core.py +++ b/discord/commands/core.py @@ -1786,12 +1786,8 @@ async def _invoke(self, ctx: ApplicationContext) -> None: v["id"] = int(i) user = v member["user"] = user - target = Member( - data=member, - guild=ctx.interaction._state._get_guild(ctx.interaction.guild_id), - state=ctx.interaction._state, - ) - + cache_flag = ctx.interaction._state.member_cache_flags.interaction + target = ctx.guild._get_and_update_member(member, user["id"], cache_flag) if self.cog is not None: await self.callback(self.cog, ctx, target) else: