Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions discord/webhook/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ async def send(
) 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(
Expand Down Expand Up @@ -1959,7 +1959,7 @@ async def fetch_message(self, id: int, /, *, thread: Snowflake = MISSING) -> Web
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()
Expand Down Expand Up @@ -2102,7 +2102,7 @@ async def edit_message(
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()
Expand Down Expand Up @@ -2164,7 +2164,7 @@ async def delete_message(self, message_id: int, /, *, thread: Snowflake = MISSIN
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()
Expand Down
8 changes: 4 additions & 4 deletions discord/webhook/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ def send(
) as params:
adapter: WebhookAdapter = _get_webhook_adapter()
thread_id: Optional[int] = None
if thread is not MISSING:
if thread:
thread_id = thread.id

data = adapter.execute_webhook(
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def fetch_message(self, id: int, /, *, thread: Snowflake = MISSING) -> SyncWebho
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: WebhookAdapter = _get_webhook_adapter()
Expand Down Expand Up @@ -1280,7 +1280,7 @@ def edit_message(
previous_allowed_mentions=previous_mentions,
) as params:
thread_id: Optional[int] = None
if thread is not MISSING:
if thread:
thread_id = thread.id

adapter: WebhookAdapter = _get_webhook_adapter()
Expand Down Expand Up @@ -1326,7 +1326,7 @@ def delete_message(self, message_id: int, /, *, thread: Snowflake = MISSING) ->
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: WebhookAdapter = _get_webhook_adapter()
Expand Down
Loading