Browse Source

Allow thread=None in Webhook.send()

Fixes https://github.com/Rapptz/discord.py/issues/10313
pull/10314/head
Levi Pesin 4 weeks ago
committed by GitHub
parent
commit
10f91236a0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      discord/webhook/async_.py

8
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()

Loading…
Cancel
Save