Class DiscordMessageBuilder
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
Constructs a message to be sent.
public sealed class DiscordMessageBuilder : DisCatSharpBuilder
- Inheritance
-
DiscordMessageBuilder
- Inherited Members
Properties
- 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.
- IsTts
Gets or Sets if the message should be TTS.
- MentionOnReply
Gets if the Reply should mention the user.
- Nonce
Gets the nonce for the message.
- Poll
Gets the poll for this message.
- ReplyId
Gets the Reply Message ID.
- Silent
Gets or Sets if the message should be send silent.
- Sticker
Gets the Sticker to be send.
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 to5
rows per message.If WithV2Components() was called, the limit changes to
10
top-level components and max30
components in total.
- 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.
- AddFile(FileStream, bool, string?)
Adds a file to the message.
- AddFile(string, Stream, bool, string?)
Adds a file to the message.
- AddFiles(Dictionary<string, Stream>, bool)
Adds file to the message.
- AsSilentMessage(bool)
Sets the followup message to be send as silent message.
- AsVoiceMessage(bool)
Sets the message to be send as voice message.
- Clear()
Allows for clearing the Message Builder so that it can be used again to send a new message.
- 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
- SuppressEmbeds(bool)
Sets the message response to suppress embeds.
- 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.
- WithEnforceNonce(bool)
Whether to enforce the nonce.
- WithFile(FileStream, bool, string)
Adds a file to the message.
- WithFile(string, Stream, bool, string)
Adds a file to the message.
- WithFiles(Dictionary<string, Stream>, bool)
Adds file to the message.
- 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.
- WithV2Components()
Sets that this builder should be using UI Kit.