Table of Contents

Class DiscordWebhookBuilder

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

Constructs ready-to-send webhook requests.

public sealed class DiscordWebhookBuilder : DisCatSharpBuilder
Inheritance
DiscordWebhookBuilder
Inherited Members

Constructors

DiscordWebhookBuilder()

Constructs a new empty webhook request builder.

Properties

AppliedTags

Forum post tags to send on this webhook request.

AvatarUrl

Avatar url to use for this webhook request.

IsTts

Whether this webhook request is text-to-speech.

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.

WithComponents

Whether to send components with this webhook requests. Set to true if you want to send components with non-application-owned webhooks.

Methods

AddComponents(params DiscordActionRowComponent[])

Appends several rows of components to the message

AddComponents(params DiscordComponent[])

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

If WithV2Components() was called, the limit changes to 10 top-level components and max 30 components in total.

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.

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.

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.

SendWithComponents()

Sets if you want to send components with non-application-owned webhooks.

SuppressEmbeds()

Sets the webhook response to suppress embeds.

WithAllowedMention(IMention)

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

WithAllowedMentions(IEnumerable<IMention>)

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

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.

WithV2Components()

Sets that this builder should be using UI Kit.