From 10f91236a0c2592569424e58098867e5da1fcd69 Mon Sep 17 00:00:00 2001 From: Levi Pesin <35454228+LeviPesin@users.noreply.github.com> Date: Sun, 21 Sep 2025 21:35:24 +0930 Subject: [PATCH] Allow thread=None in Webhook.send() Fixes https://github.com/Rapptz/discord.py/issues/10313 --- discord/webhook/async_.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 9d4fa0da6..3c4d05e5e 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1894,7 +1894,7 @@ class Webhook(BaseWebhook): ) as params: adapter = async_context.get() thread_id: Optional[int] = None - if thread is not MISSING: + if thread: thread_id = thread.id data = await adapter.execute_webhook( @@ -1959,7 +1959,7 @@ class Webhook(BaseWebhook): raise ValueError('This webhook does not have a token associated with it') thread_id: Optional[int] = None - if thread is not MISSING: + if thread: thread_id = thread.id adapter = async_context.get() @@ -2102,7 +2102,7 @@ class Webhook(BaseWebhook): previous_allowed_mentions=previous_mentions, ) as params: thread_id: Optional[int] = None - if thread is not MISSING: + if thread: thread_id = thread.id adapter = async_context.get() @@ -2164,7 +2164,7 @@ class Webhook(BaseWebhook): raise ValueError('This webhook does not have a token associated with it') thread_id: Optional[int] = None - if thread is not MISSING: + if thread: thread_id = thread.id adapter = async_context.get()