From 79d57bbd3c5415df03b8a4cb609359fef48c1ef7 Mon Sep 17 00:00:00 2001 From: Paillat-dev Date: Fri, 4 Apr 2025 23:14:33 +0200 Subject: [PATCH 1/2] :bug: ensure payload is initialized before adding thread_name in async and sync webhooks --- discord/webhook/async_.py | 1 + discord/webhook/sync.py | 1 + 2 files changed, 2 insertions(+) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 4b87a7e0f3..35652612a0 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -345,6 +345,7 @@ def execute_webhook( params["thread_id"] = thread_id if thread_name: + payload = payload or {} payload["thread_name"] = thread_name route = Route( diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index d2d3213d71..fe10d8e86a 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -315,6 +315,7 @@ def execute_webhook( params["thread_id"] = thread_id if thread_name: + payload = payload or {} payload["thread_name"] = thread_name route = Route( From a81805f1f3d1b84f285e8d07f7dd0f32c9da94f4 Mon Sep 17 00:00:00 2001 From: Paillat-dev Date: Fri, 4 Apr 2025 23:22:32 +0200 Subject: [PATCH 2/2] :memo: CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38725e4141..58c09b6dc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2739](https://github.com/Pycord-Development/pycord/pull/2739)) - Fixed missing `None` type hints in `Select.__init__`. ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) +- Fixed `TypeError` when specifying `thread_name` in `Webhook.send` + ([#2761])(https://github.com/Pycord-Development/pycord/pull/2761) ### Changed