Table of Contents

Class BaseDiscordMessageBuilder<T>

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

An abstraction for the different message builders in DSharpPlus.

public abstract class BaseDiscordMessageBuilder<T> : IDiscordMessageBuilder where T : BaseDiscordMessageBuilder<T>

Type Parameters

T
Inheritance
object
BaseDiscordMessageBuilder<T>
Implements
Derived

Constructors

BaseDiscordMessageBuilder(IDiscordMessageBuilder)

Constructs a new BaseDiscordMessageBuilder<T> based on an existing IDiscordMessageBuilder. Existing file streams will have their position reset to 0.

Properties

ComponentActionRows

Components, filtered for only action rows.

Components

Components to send on this message.

Content

The contents of this message.

Embeds

Embeds to send on this webhook request.

Files

Files to send on this webhook request.

Flags
IsTTS

Whether this message will play as a text-to-speech message.

Mentions

Mentions to send on this webhook request.

Poll

Gets or sets a poll for this message.

Methods

AddActionRowComponent(DiscordActionRowComponent)
AddActionRowComponent(DiscordSelectComponent)

Adds a new action row with the given component.

AddActionRowComponent(params IEnumerable<DiscordButtonComponent>)

Adds buttons to the builder.

AddContainerComponent(DiscordContainerComponent)

Adds a container component to this builder.

AddEmbed(DiscordEmbed)

Appends an embed to the current builder.

AddEmbeds(IEnumerable<DiscordEmbed>)

Appends several embeds to the current builder.

AddFile(FileStream, AddFileOptions)

Attaches a file to this message.

AddFile(FileStream, bool)

Sets if the message has files to be sent.

AddFile(string, Stream, AddFileOptions)

Attaches a file to this message.

AddFile(string, Stream, bool)

Sets if the message has files to be sent.

AddFileComponent(DiscordFileComponent)

Adds a file component to this builder.

AddFiles(IDictionary<string, Stream>, AddFileOptions)

Attaches multiple files to this message.

AddFiles(IDictionary<string, Stream>, bool)

Sets if the message has files to be sent.

AddFiles(IEnumerable<DiscordMessageFile>)
AddMediaGalleryComponent(params IEnumerable<DiscordMediaGalleryItem>)

Adds a media gallery to this builder.

AddMention(IMention)

Adds the mention to the mentions to parse, etc. with the interaction response.

AddMentions(IEnumerable<IMention>)

Adds the mentions to the mentions to parse, etc. with the interaction response.

AddSectionComponent(DiscordSectionComponent)

Adds a section component to the builder.

AddSeparatorComponent(DiscordSeparatorComponent)

Adds a separator component to this builder.

AddTextDisplayComponent(DiscordTextDisplayComponent)

Adds a text display to this builder.

AddTextDisplayComponent(string)

Adds a text display to this builder.

AddTextInputComponent(DiscordTextInputComponent)

Adds a text input to this builder.

Clear()

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

ClearComponents()

Clears all message components on this builder.

ClearEmbeds()

Clears the embeds on the current builder.

DisableV2Components()

Disables V2 components IF this builder does not currently contain illegal components.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

EnableV2Components()

Enables support for V2 components; messages with the V2 flag cannot be downgraded.

RemoveEmbedAt(int)

Removes the embed at the specified index.

RemoveEmbeds(int, int)

Removes the specified range of embeds.

SuppressNotifications()
WithContent(string)

Sets the content of the Message.

WithPoll(DiscordPollBuilder)
WithTTS(bool)

Sets if the message should be TTS.