Discord.Net icon indicating copy to clipboard operation
Discord.Net copied to clipboard

[Bug]: Can't use the SuppressNotification flag with webhooks

Open mujurin1 opened this issue 6 months ago • 0 comments

Check The Docs

  • [X] I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • [X] I verified the issue was caused by Discord.Net.

Check your intents

  • [X] I double checked that I have the required intents.

Description

Can't use the SuppressNotification flag with webhooks. This flag is actually available for webhooks.

Version

3.15.3

Working Version

No response

Logs

Unhandled exception. System.ArgumentException: The only valid MessageFlags are SuppressEmbeds and none. (Parameter 'flags')
   at Discord.Webhook.WebhookClientHelper.SendMessageAsync(DiscordWebhookClient client, String text, Boolean isTTS, IEnumerable`1 embeds, String username, String avatarUrl, AllowedMentions allowedMentions, RequestOptions options, MessageComponent components, MessageFlags flags, Nullable`1 threadId, String threadName, UInt64[] appliedTags, PollProperties poll)
   at Program.<Main>$(String[] args) in D:\Programing\ConsoleApp\Program.cs:line 7
   at Program.<Main>(String[] args)

Sample

var client = new DiscordWebhookClient(url);
await client.SendMessageAsync(
    "message",
    flags: MessageFlags.SuppressNotification
);

Packages

Discord.Net.Webhook Version:3.15.3

Environment

Irrelevant.

mujurin1 avatar Jul 30 '24 18:07 mujurin1