-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging
Description
Summary
Webhook.send() doesn't accept thread=None
Reproduction Steps
thread=None cannot be used in Webhook.send() method. It is useful when I want to send a message to a channel/thread (code doesn't know which one).
Minimal Reproducible Code
dst = some_channel
webhook = await (dst if not isinstance(dst, Thread) else dst.parent).create_webhook(name='webhook')
await webhook.send(content='something', thread=None if not isinstance(dst, Thread) else dst)Expected Results
Works.
Actual Results
File "/data/project/rv/pyvenv/lib/python3.13/site-packages/discord/webhook/async_.py", line 1898, in send
thread_id = thread.id
^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'id'
Intents
N/A
System Information
N/A
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging