Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AttributeError when failing to establish initial websocket connection #2301

Merged
merged 6 commits into from Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
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
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