Skip to content

Commit

Permalink
fix: AttributeError when failing to establish initial websocket con…
Browse files Browse the repository at this point in the history
…nection. (#2301)

* fix #2300

* Update CHANGELOG.md

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

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Dorukyum <[email protected]>
Signed-off-by: Dasupergrasskakjd <[email protected]>

---------

Signed-off-by: Dasupergrasskakjd <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Dorukyum <[email protected]>
  • Loading branch information
3 people authored Dec 27, 2023
1 parent ff2037f commit ec212e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2257](https://github.com/Pycord-Development/pycord/issues/2257))
- Fixed `AuditLogIterator` not respecting the `after` parameter.
([#2295](https://github.com/Pycord-Development/pycord/issues/2295))
- Fixed `AttributeError` when failing to establish initial websocket connection.
([#2301](https://github.com/Pycord-Development/pycord/pull/2301))

## [2.4.1] - 2023-03-20

Expand Down
2 changes: 2 additions & 0 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,8 @@ async def connect(self, *, reconnect: bool = True) -> None:
# Always try to RESUME the connection
# If the connection is not RESUME-able then the gateway will invalidate the session.
# This is apparently what the official Discord client does.
if self.ws is None:
continue
ws_params.update(
sequence=self.ws.sequence, resume=True, session=self.ws.session_id
)
Expand Down

0 comments on commit ec212e2

Please sign in to comment.