Skip to content

Commit 79d57bb

Browse files
committed
🐛 ensure payload is initialized before adding thread_name in async and sync webhooks
1 parent ae38322 commit 79d57bb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

discord/webhook/async_.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ def execute_webhook(
345345
params["thread_id"] = thread_id
346346

347347
if thread_name:
348+
payload = payload or {}
348349
payload["thread_name"] = thread_name
349350

350351
route = Route(

discord/webhook/sync.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ def execute_webhook(
315315
params["thread_id"] = thread_id
316316

317317
if thread_name:
318+
payload = payload or {}
318319
payload["thread_name"] = thread_name
319320

320321
route = Route(

0 commit comments

Comments
 (0)