Class OutgoingMessage
An immutable, validated message to send. Build it with Create() or To(params IEnumerable<Recipient>) and the fluent OutgoingMessageBuilder.
public sealed class OutgoingMessage
- Inheritance
-
OutgoingMessage
- Inherited Members
Examples
var message = OutgoingMessage.To(PhoneNumber.Parse("+4915112345678"))
.WithStyledText("**Hello**")
.WithAttachment(bytes, "image/png", "chart.png")
.Build();
Properties
Attachments
Attachments as base64 or data URIs (data:<mime>;filename=<name>;base64,<data>).
public IReadOnlyList<string> Attachments { get; }
Property Value
EditTimestamp
Timestamp of a previously sent message to edit; null for a new message.
public long? EditTimestamp { get; }
Property Value
- long?
LinkPreview
The link preview for a URL in Text, if any.
public LinkPreview? LinkPreview { get; }
Property Value
Mentions
Mentions inside Text.
public IReadOnlyList<Mention> Mentions { get; }
Property Value
NotifySelf
Whether the sending account's other devices should notify; null uses the API default.
public bool? NotifySelf { get; }
Property Value
- bool?
Quote
The message being replied to, if any.
public Quote? Quote { get; }
Property Value
Recipients
The recipients (at least one, without duplicates).
public IReadOnlyList<Recipient> Recipients { get; }
Property Value
Sticker
The sticker to send, if any. Never combined with Attachments.
public Sticker? Sticker { get; }
Property Value
Text
The message body, if any.
public string? Text { get; }
Property Value
TextMode
How Text is interpreted.
public TextMode TextMode { get; }
Property Value
ViewOnce
Whether the message can be viewed only once.
public bool ViewOnce { get; }
Property Value
Methods
Create()
Starts building a message without recipients.
public static OutgoingMessageBuilder Create()
Returns
- OutgoingMessageBuilder
A new builder.
To(params IEnumerable<Recipient>)
Starts building a message to the given recipients.
public static OutgoingMessageBuilder To(params IEnumerable<Recipient> recipients)
Parameters
recipientsIEnumerable<Recipient>The recipients. Phone numbers and group ids convert implicitly.
Returns
- OutgoingMessageBuilder
A new builder.