From 3bb04fbe7757a919a1108f71dc070f8c8d069ee7 Mon Sep 17 00:00:00 2001 From: plun1331 Date: Mon, 9 Sep 2024 13:05:32 -0700 Subject: [PATCH 1/2] fix: user context command member having a `None` guild Signed-off-by: plun1331 --- discord/commands/core.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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: From 0173c2b7e729685c5ea4cd64d5813c598e50354d Mon Sep 17 00:00:00 2001 From: plun1331 Date: Mon, 9 Sep 2024 13:07:37 -0700 Subject: [PATCH 2/2] Update CHANGELOG.md Signed-off-by: plun1331 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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