Skip to content

Commit fc1596d

Browse files
committed
update readme
1 parent d478df4 commit fc1596d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pip install discord-webhook
1818
* [Basic Webhook](#basic-webhook)
1919
* [Create Multiple Instances / Use multiple URLs](#create-multiple-instances)
2020
* [Get Webhook by ID](#get-webhook-by-id)
21+
* [Send Webhook to thread](#send-webhook-to-thread)
2122
* [Manage Being Rate Limited](#manage-being-rate-limited)
2223
* [Embedded Content](#webhook-with-embedded-content)
2324
* [Edit Webhook Message](#edit-webhook-messages)
@@ -61,6 +62,19 @@ webhook = DiscordWebhook(url="your webhook url", id="your webhook message id")
6162
# now you could delete or edit the webhook
6263
# ...
6364
````
65+
### Send Webhook to thread
66+
You can send a message to an existing thread by setting `thread_id` or create a new thread in a forum channel by using a `thread_name`.
67+
```python
68+
from discord_webhook import DiscordWebhook
69+
70+
# send to an existing thread
71+
webhook = DiscordWebhook(url="your webhook url", thread_id="the thread id")
72+
webhook.execute()
73+
74+
# create a new thread in a forum channel
75+
webhook = DiscordWebhook(url="your webhook url", thread_name="some-thread-name")
76+
webhook.execute()
77+
```
6478

6579
### Manage being Rate Limited
6680

0 commit comments

Comments
 (0)