From ff897cb70739381d98a713dedd69b1e6b9cf44c8 Mon Sep 17 00:00:00 2001 From: Dasupergrasskakjd Date: Mon, 25 Dec 2023 17:17:31 +0000 Subject: [PATCH 1/5] fix #2300 --- discord/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discord/client.py b/discord/client.py index 5a025aa660..3144011967 100644 --- a/discord/client.py +++ b/discord/client.py @@ -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 ) From 1779749411cb9593354e5d2741d1999fc10be224 Mon Sep 17 00:00:00 2001 From: Dasupergrasskakjd Date: Mon, 25 Dec 2023 17:27:47 +0000 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ece1cf3d2..ac3389746b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -125,7 +125,7 @@ These changes are available on the `master` branch, but have not yet been releas classes. ([#2063](https://github.com/Pycord-Development/pycord/pull/2063)) ### Fixed - +- Fixed `AttributeError` when user has unstable internet ([#2301](https://github.com/Pycord-Development/pycord/pull/2301)) - Fixed `AttributeError` caused by [#1957](https://github.com/Pycord-Development/pycord/pull/1957) when using listeners in cogs. ([#1989](https://github.com/Pycord-Development/pycord/pull/1989)) From 4d6edfb5cfbf12526e528b46b75f60195035643b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 17:28:10 +0000 Subject: [PATCH 3/5] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac3389746b..a968c9c164 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -125,7 +125,9 @@ These changes are available on the `master` branch, but have not yet been releas classes. ([#2063](https://github.com/Pycord-Development/pycord/pull/2063)) ### Fixed -- Fixed `AttributeError` when user has unstable internet ([#2301](https://github.com/Pycord-Development/pycord/pull/2301)) + +- Fixed `AttributeError` when user has unstable internet + ([#2301](https://github.com/Pycord-Development/pycord/pull/2301)) - Fixed `AttributeError` caused by [#1957](https://github.com/Pycord-Development/pycord/pull/1957) when using listeners in cogs. ([#1989](https://github.com/Pycord-Development/pycord/pull/1989)) From 3869a80e672588bb0eb779406856179df6d6042f Mon Sep 17 00:00:00 2001 From: Dasupergrasskakjd Date: Mon, 25 Dec 2023 20:01:00 +0000 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a968c9c164..5d6007b01a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -126,8 +126,6 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed `AttributeError` when user has unstable internet - ([#2301](https://github.com/Pycord-Development/pycord/pull/2301)) - Fixed `AttributeError` caused by [#1957](https://github.com/Pycord-Development/pycord/pull/1957) when using listeners in cogs. ([#1989](https://github.com/Pycord-Development/pycord/pull/1989)) @@ -205,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` in `client.connect` when user has unstable internet + ([#2301](https://github.com/Pycord-Development/pycord/pull/2301)) ## [2.4.1] - 2023-03-20 From e130ff57c8068f14c904f9c71fc576da68166f5a Mon Sep 17 00:00:00 2001 From: Dasupergrasskakjd <106623583+Dasupergrasskakjd@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:48:26 +0000 Subject: [PATCH 5/5] Update CHANGELOG.md Co-authored-by: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Signed-off-by: Dasupergrasskakjd <106623583+Dasupergrasskakjd@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d6007b01a..e8878fadad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -203,7 +203,7 @@ 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` in `client.connect` when user has unstable internet +- Fixed `AttributeError` when failing to establish initial websocket connection. ([#2301](https://github.com/Pycord-Development/pycord/pull/2301)) ## [2.4.1] - 2023-03-20