Table of Contents

Class DiscordMessageBuilder

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

Constructs a Message to be sent.

public sealed class DiscordMessageBuilder
Inheritance
DiscordMessageBuilder
Inherited Members

Properties

Attachments

Gets the Attachments to be sent in the Message.

Components

Gets the components that will be attached to the message.

Content

Gets or Sets the Message to be sent.

Embed

Gets or sets the embed for the builder. This will always set the builder to have one embed.

Embeds

Gets the Embeds to be sent.

EnforceNonce

Gets whether to enforce the nonce.

FailOnInvalidReply

Gets if the Reply will error if the Reply Message Id does not reference a valid message.

If set to false, invalid replies are send as a regular message.

Defaults to false.

Files

Gets the Files to be sent in the Message.

IsTts

Gets or Sets if the message should be TTS.

MentionOnReply

Gets if the Reply should mention the user.

Mentions

Gets the Allowed Mentions for the message to be sent.

Nonce

Gets the nonce for the message.

Poll

Gets the poll for this message.

ReplyId

Gets the Reply Message ID.

Sticker

Gets the Sticker to be send.

Suppressed

Gets if the embeds should be suppressed.

Methods

AddComponents(params DiscordActionRowComponent[])

Appends several rows of components to the message

AddComponents(params DiscordComponent[])

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

AddComponents(IEnumerable<DiscordActionRowComponent>)

Appends several rows of components to the message

AddComponents(IEnumerable<DiscordComponent>)

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

AddEmbed(DiscordEmbed)

Appends an embed to the current builder.

AddEmbeds(IEnumerable<DiscordEmbed>)

Appends several embeds to the current builder.

AddGcpAttachment(GcpAttachmentUploadInformation)
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.

ClearPoll()

Clears the poll from this builder.

HasTts(bool)

Sets if the message should be TTS.

KeepAttachments(bool)

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

ModifyAsync(DiscordMessage)

Sends the modified message.

Note: Message replies cannot be modified. To clear the reply, simply pass null to WithReply(ulong, bool, bool).

ModifyAttachments(IEnumerable<DiscordAttachment>)

Modifies the given attachments on edit.

SendAsync(DiscordChannel)

Sends the Message to a specific channel

WithAllowedMention(IMention)

Sets if the message has allowed mentions.

WithAllowedMentions(IEnumerable<IMention>)

Sets if the message has allowed mentions.

WithContent(string)

Sets the Content of the Message.

WithEmbed(DiscordEmbed)

Sets the embed for the current builder.

WithEnforceNonce(bool)

Whether to enforce the nonce.

WithFile(FileStream, bool, string)

Sets if the message has files to be sent.

WithFile(string, Stream, bool, string)

Sets if the message has files to be sent.

WithFiles(Dictionary<string, Stream>, bool)

Sets if the message has files to be sent.

WithNonce(string)

Sets the nonce for the message.

WithPoll(DiscordPollBuilder)

Adds a poll to the message.

WithReply(ulong, bool, bool)

Sets if the message is a reply

WithSticker(DiscordSticker)

Adds a sticker to the message. Sticker must be from current guild.