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 Ssts if the message should be sent silent.
- StickerIds
Gets the Sticker to be sent.
Methods
- AddComponents(params DiscordActionRowComponent[])
Appends several rows of components to the message
- AddComponents(params DiscordComponent[])
Adds components to the message.
If WithV2Components() was called, the limit changes to max
40components in total.
- AddComponents(IEnumerable<DiscordActionRowComponent>)
Appends several rows of components to the message
- AddComponents(IEnumerable<DiscordComponent>)
Adds components to the message.
If WithV2Components() was called, the limit changes to max
40components in total.
- 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()
Sets the followup message to be sent as silent message.
- AsVoiceMessage()
Sets the message to be sent as voice message.
- Clear()
Allows for clearing the builder so that it can be used again.
- ClearComponents()
Clears the components on this builder.
- DisableAllComponents()
Disables all buttons and selects in the builder.
- DisableComponentsByCustomId(params string[])
Disables all buttons and selects with the specified custom IDs.
- DisableComponentsById(params int[])
Disables all buttons and selects with the specified component IDs.
- EnableAllComponents()
Enables all buttons and selects in the builder.
- EnableComponentsByCustomId(params string[])
Enables all buttons and selects with the specified custom IDs.
- EnableComponentsById(params int[])
Enables all buttons and selects with the specified component IDs.
- HasTts(bool)
Sets if the message should be TTS.
- InjectComponentsFromMessage(DiscordMessage)
Injects components and attachments from an existing message.
- 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.
- ModifyComponentByCustomId(string, Action<DiscordComponent>)
Modifies a component with the specified custom ID using the provided action.
- SendAsync(DiscordChannel)
Sends the Message to a specific channel
- SuppressEmbeds()
Sets the message response to suppress embeds. This also clears the embeds of the message.
- 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.
- 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.
- WithStickerIds(IEnumerable<ulong>)
Adds stickers to the message. Sticker must be from current guild.
- WithStickerIds(params ulong[])
Adds stickers to the message. Sticker must be from current guild.
- WithV2Components()
Sets that this builder should be using UI Kit.