Class DiscordMessageBuilder
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
Constructs a Message to be sent.
public sealed class DiscordMessageBuilder : BaseDiscordMessageBuilder<DiscordMessageBuilder>, IDiscordMessageBuilder
- Inheritance
-
DiscordMessageBuilder
- Implements
- Inherited Members
Constructors
- DiscordMessageBuilder()
Constructs a new discord message builder
- DiscordMessageBuilder(DiscordMessage)
Constructs a new discord message builder based on the passed message.
- DiscordMessageBuilder(DiscordMessageBuilder)
Constructs a new discord message builder based on a previous builder.
- DiscordMessageBuilder(DiscordMessageSnapshotContent)
Constructs a new discord message builder based on the passed message snapshot.
- DiscordMessageBuilder(IDiscordMessageBuilder)
Copies the common properties from the passed builder.
Properties
- Embed
Gets or sets the embed for the builder. This will always set the builder to have one embed.
- 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.
- MentionOnReply
Gets if the Reply should mention the user.
- ReplyId
Gets the Reply Message ID.
- Sticker
Gets or sets the sticker for the builder. This will always set the builder to have one sticker.
- Stickers
The stickers to attach to the message.
Methods
- ModifyAsync(DiscordMessage)
Sends the modified message.
Note: Message replies cannot be modified. To clear the reply, simply pass null to WithReply(ulong?, bool, bool).
- 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.
- WithEmbed(DiscordEmbed)
Sets the embed for the current builder.
- WithReply(ulong?, bool, bool)
Sets if the message is a reply
- WithSticker(DiscordMessageSticker)
Adds a sticker to the message. Sticker must be from current guild.
- WithStickers(IEnumerable<DiscordMessageSticker>)
Adds a sticker to the message. Sticker must be from current guild.