Skip to content

Commit

Permalink
fix: user context command members having a None guild (#2573)
Browse files Browse the repository at this point in the history
* fix: user context command member having a `None` guild

Signed-off-by: plun1331 <plun1331@gmail.com>

* Update CHANGELOG.md

Signed-off-by: plun1331 <plun1331@gmail.com>

---------

Signed-off-by: plun1331 <plun1331@gmail.com>
  • Loading branch information
plun1331 authored Sep 10, 2024
1 parent ac4e173 commit 646e51a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 2 additions & 6 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 646e51a

Please sign in to comment.