Table of Contents

Class DiscordWebhookBuilder

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

Constructs ready-to-send webhook requests.

public sealed class DiscordWebhookBuilder
Inheritance
DiscordWebhookBuilder
Inherited Members

Constructors

DiscordWebhookBuilder()

Constructs a new empty webhook request builder.

Properties

AppliedTags

Forum post tags to send on this webhook request.

Attachments

Attachments to keep on this webhook request.

AvatarUrl

Avatar url to use for this webhook request.

Components

Gets the components.

Content

Message to send on this webhook request.

Embeds

Embeds to send on this webhook request.

EmbedsSuppressed

Whether to suppress embeds.

Files

Files to send on this webhook request.

IsTts

Whether this webhook request is text-to-speech.

IsVoiceMessage

Whether to send as voice message. You can't use that on your own, it needs DisCatSharp.Experimental.

Mentions

Mentions to send on this webhook request.

NotificationsSuppressed

Whether to send as silent message.

Poll

Gets the poll for this message.

ThreadName

Name of the new thread. Only works if the webhook is send in a Forum.

Username

Username to use for this webhook request.

Methods

AddComponents(params DiscordComponent[])

Adds a row of components to the builder, up to 5 components per row, and up to 5 rows per message.

AddComponents(IEnumerable<DiscordActionRowComponent>)

Appends several rows of components to the builder

AddComponents(IEnumerable<DiscordComponent>)

Adds a row of components to the builder, up to 5 components per row, and up to 5 rows per message.

AddEmbed(DiscordEmbed)

Adds an embed to send at the execution of the webhook.

AddEmbeds(IEnumerable<DiscordEmbed>)

Adds the given embeds to send at the execution of the webhook.

AddFile(FileStream, bool, string)

Sets if the message has files to be sent.

AddFile(string, Stream, bool, string)

Adds a file to send at the execution of the webhook.

AddFiles(Dictionary<string, Stream>, bool)

Adds the given files to send at the execution of the webhook.

AddMention(IMention)

Adds the mention to the mentions to parse, etc. at the execution of the webhook.

AddMentions(IEnumerable<IMention>)

Adds the mentions to the mentions to parse, etc. at the execution of the webhook.

AsSilentMessage()

Sets the webhook to be send as silent message.

AsVoiceMessage()

Sets the webhook to be send as voice message.

Clear()

Allows for clearing the Webhook Builder so that it can be used again to send a new message.

ClearComponents()

Clears all message components on this builder.

ClearPoll()

Clears the poll from this builder.

KeepAttachments(bool)

Whether to keep the message attachments, if new ones are added.

ModifyAsync(DiscordWebhook, DiscordMessage)

Sends the modified webhook message.

ModifyAsync(DiscordWebhook, DiscordMessage, DiscordThreadChannel)

Sends the modified webhook message.

ModifyAsync(DiscordWebhook, ulong)

Sends the modified webhook message.

ModifyAsync(DiscordWebhook, ulong, ulong)

Sends the modified webhook message.

ModifyAttachments(IEnumerable<DiscordAttachment>)

Modifies the given attachments on edit.

SendAsync(DiscordWebhook)

Executes a webhook.

SendAsync(DiscordWebhook, ulong)

Executes a webhook.

SuppressEmbeds()

Sets the webhook response to suppress embeds.

WithAppliedTags(IEnumerable<ulong>)

Tags to apply to forum posts.

WithAvatarUrl(string)

Sets the avatar of this webhook builder from its url.

WithContent(string)

Sets the message to send at the execution of the webhook.

WithPoll(DiscordPollBuilder)

Adds a poll to this webhook builder.

WithThreadName(string)

Sets the thread name to create at the execution of the webhook. Only works for Forum.

WithTts(bool)

Indicates if the webhook must use text-to-speech.

WithUsername(string)

Sets the username for this webhook builder.