Skip to content

Commit

Permalink
fix: DMChannel.recipient and User.dm_channel being None after calling…
Browse files Browse the repository at this point in the history
… User.create_dm (Pycord-Development#2219)

* Fix self.recipient

* style(pre-commit): auto fixes from pre-commit.com hooks

* CHANGELOG

---------

Signed-off-by: David Hozic <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
davidhozic and pre-commit-ci[bot] authored Aug 29, 2023
1 parent a3bd2a0 commit 402f2bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2191](https://github.com/Pycord-Development/pycord/pull/2191))
- Fixed a misplaced payload object inside of the thread creation payload.
([#2192](https://github.com/Pycord-Development/pycord/pull/2192))
- Fixed `DMChannel.recipient` being None and consequently `User.dm_channel` also being
None. ([#2219](https://github.com/Pycord-Development/pycord/pull/2219))

## [2.4.1] - 2023-03-20

Expand Down
2 changes: 1 addition & 1 deletion discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,7 @@ def __init__(
self._state: ConnectionState = state
self.recipient: User | None = None
if r := data.get("recipients"):
self.recipient: state.store_user(r[0])
self.recipient = state.store_user(r[0])
self.me: ClientUser = me
self.id: int = int(data["id"])

Expand Down

0 comments on commit 402f2bd

Please sign in to comment.