@@ -18,14 +18,15 @@ 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 )
21+ * [ Send Webhook to a thread] ( #send-webhook-to-a -thread )
2222* [ Manage Being Rate Limited] ( #manage-being-rate-limited )
2323* [ Embedded Content] ( #webhook-with-embedded-content )
2424* [ Edit Webhook Message] ( #edit-webhook-messages )
2525* [ Delete Webhook Message] ( #delete-webhook-messages )
2626* [ Send Files] ( #send-files )
2727* [ Remove Embeds and Files] ( #remove-embeds-and-files )
2828* [ Allowed Mentions] ( #allowed-mentions )
29+ * [ Use Message Flags] ( #use-message-flags )
2930* [ Use Proxies] ( #use-proxies )
3031* [ Timeout] ( #timeout )
3132* [ Async Support] ( #async-support )
@@ -62,7 +63,7 @@ webhook = DiscordWebhook(url="your webhook url", id="your webhook message id")
6263# now you could delete or edit the webhook
6364# ...
6465````
65- ### Send Webhook to thread
66+ ### Send Webhook to a thread
6667You 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 ` .
6768``` python
6869from discord_webhook import DiscordWebhook
@@ -294,7 +295,7 @@ response = webhook.execute()
294295
295296### Allowed Mentions
296297
297- Look into the [ Discord Docs] ( https://discord.com/developers/docs/resources/channel#allowed-mentions-object ) for examples and for more explanation
298+ Look into the [ Discord Docs] ( https://discord.com/developers/docs/resources/channel#allowed-mentions-object ) for examples and for more explanation.
298299
299300This example would only ping user ` 123 ` and ` 124 ` but not everyone else.
300301
@@ -311,6 +312,28 @@ webhook = DiscordWebhook(url="your webhook url", content=content, allowed_mentio
311312response = webhook.execute()
312313```
313314
315+ ### Use Message Flags
316+
317+ Flags can also be set for messages. Only two are currently supported.
318+
319+ ``` python
320+ from discord_webhook import DiscordEmbed, DiscordWebhook
321+ from discord_webhook.constants import MessageFlags
322+
323+ content = " Hi."
324+
325+ # this message will not trigger push and desktop notifications
326+ webhook = DiscordWebhook(url = " your webhook url" , content = content, flags = MessageFlags.SUPPRESS_NOTIFICATIONS .value)
327+ response = webhook.execute()
328+
329+ # do not include any embeds when serializing this message
330+ webhook = DiscordWebhook(url = " your webhook url" , content = content, flags = MessageFlags.SUPPRESS_EMBEDS .value)
331+ embed = DiscordEmbed(title = " Your Title" , description = " Lorem ipsum dolor sit" , color = " 03b2f8" )
332+ webhook.add_embed(embed)
333+ # even if an embed has been added, it will not appear in the message.
334+ response = webhook.execute()
335+ ```
336+
314337### Use Proxies
315338
316339``` python
0 commit comments