Table of Contents

Class MessageInput

Namespace
idunno.Bluesky.Chat
Assembly
idunno.Bluesky.dll

Represents a message in a chat conversation.

public sealed record MessageInput : IEquatable<MessageInput>

Inheritance

Implements

Inherited Members

Constructors

MessageInput(string, ICollection<Facet>?, EmbeddedRecord?, ReplyReference?)

Creates a new instance of idunno.Bluesky.Chat.MessageInput.

public MessageInput(string text, ICollection<Facet>? facets = null, EmbeddedRecord? embed = null, ReplyReference? replyTo = null)

Parameters

text string

The text for the message.

facets ICollection<Facet>?

The rich text idunno.Bluesky.RichText.Facets for the message, if any.

embed EmbeddedRecord?

The idunno.Bluesky.Embed.EmbeddedRecord for the message, if any.

replyTo ReplyReference?

The message this message is replying to. The referenced message must be in the same conversation.

Exceptions

ArgumentNullException

Thrown when text is null.

ArgumentOutOfRangeException

Thrown when text exceeds the maximum allowed length.

MessageInput(string, ICollection<Facet>?, EmbeddedRecord?, ReplyReference?)

Creates a new instance of idunno.Bluesky.Chat.MessageInput.

public MessageInput(string text, ICollection<Facet>? facets = null, EmbeddedRecord? embed = null, ReplyReference? replyTo = null)

Parameters

text string

The text for the message.

facets ICollection<Facet>?

The rich text idunno.Bluesky.RichText.Facets for the message, if any.

embed EmbeddedRecord?

The idunno.Bluesky.Embed.EmbeddedRecord for the message, if any.

replyTo ReplyReference?

The message this message is replying to. The referenced message must be in the same conversation.

Exceptions

ArgumentNullException

Thrown when text is null.

ArgumentOutOfRangeException

Thrown when text exceeds the maximum allowed length.

MessageInput(string, ICollection<Facet>?, EmbeddedRecord?, ReplyReference?)

Creates a new instance of idunno.Bluesky.Chat.MessageInput.

public MessageInput(string text, ICollection<Facet>? facets = null, EmbeddedRecord? embed = null, ReplyReference? replyTo = null)

Parameters

text string

The text for the message.

facets ICollection<Facet>?

The rich text idunno.Bluesky.RichText.Facets for the message, if any.

embed EmbeddedRecord?

The idunno.Bluesky.Embed.EmbeddedRecord for the message, if any.

replyTo ReplyReference?

The message this message is replying to. The referenced message must be in the same conversation.

Exceptions

ArgumentNullException

Thrown when text is null.

ArgumentOutOfRangeException

Thrown when text exceeds the maximum allowed length.

Properties

Embed

Gets the embedded record of the message, if any.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EmbeddedBase? Embed { get; init; }

Property Value

EmbeddedBase?

Embed

Gets the embedded record of the message, if any.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EmbeddedBase? Embed { get; init; }

Property Value

EmbeddedBase?

Embed

Gets the embedded record of the message, if any.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EmbeddedBase? Embed { get; init; }

Property Value

EmbeddedBase?

Facets

Gets the rich text idunno.Bluesky.RichText.Facets of the message, if any.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyCollection<Facet>? Facets { get; init; }

Property Value

IReadOnlyCollection<Facet>?

Remarks

A facet's range is a pair of byte offsets into idunno.Bluesky.Chat.MessageInput.Text, so facets are only meaningful alongside the text they were extracted from. The value supplied is copied, so later changes to the collection passed in are not reflected here.

Facets

Gets the rich text idunno.Bluesky.RichText.Facets of the message, if any.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyCollection<Facet>? Facets { get; init; }

Property Value

IReadOnlyCollection<Facet>?

Remarks

A facet's range is a pair of byte offsets into idunno.Bluesky.Chat.MessageInput.Text, so facets are only meaningful alongside the text they were extracted from. The value supplied is copied, so later changes to the collection passed in are not reflected here.

Facets

Gets the rich text idunno.Bluesky.RichText.Facets of the message, if any.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyCollection<Facet>? Facets { get; init; }

Property Value

IReadOnlyCollection<Facet>?

Remarks

A facet's range is a pair of byte offsets into idunno.Bluesky.Chat.MessageInput.Text, so facets are only meaningful alongside the text they were extracted from. The value supplied is copied, so later changes to the collection passed in are not reflected here.

ReplyTo

Gets the message this message is replying to. The referenced message must be in the same conversation.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReplyReference? ReplyTo { get; init; }

Property Value

ReplyReference?

ReplyTo

Gets the message this message is replying to. The referenced message must be in the same conversation.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReplyReference? ReplyTo { get; init; }

Property Value

ReplyReference?

ReplyTo

Gets the message this message is replying to. The referenced message must be in the same conversation.

[JsonInclude]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ReplyReference? ReplyTo { get; init; }

Property Value

ReplyReference?

Text

Gets the text of the message

[JsonInclude]
[JsonRequired]
public string Text { get; init; }

Property Value

string

Remarks

The value supplied is validated against the same limits the constructor applies, so the limits cannot be bypassed by assigning in an object initializer or a with expression.

Exceptions

ArgumentNullException

Thrown when the value set is null.

ArgumentOutOfRangeException

Thrown when the value set exceeds the maximum allowed length.

Text

Gets the text of the message

[JsonInclude]
[JsonRequired]
public string Text { get; init; }

Property Value

string

Remarks

The value supplied is validated against the same limits the constructor applies, so the limits cannot be bypassed by assigning in an object initializer or a with expression.

Exceptions

ArgumentNullException

Thrown when the value set is null.

ArgumentOutOfRangeException

Thrown when the value set exceeds the maximum allowed length.

Text

Gets the text of the message

[JsonInclude]
[JsonRequired]
public string Text { get; init; }

Property Value

string

Remarks

The value supplied is validated against the same limits the constructor applies, so the limits cannot be bypassed by assigning in an object initializer or a with expression.

Exceptions

ArgumentNullException

Thrown when the value set is null.

ArgumentOutOfRangeException

Thrown when the value set exceeds the maximum allowed length.

Methods

<Clone>$()

public MessageInput <Clone>$()

Returns

MessageInput

<Clone>$()

public MessageInput <Clone>$()

Returns

MessageInput

<Clone>$()

public MessageInput <Clone>$()

Returns

MessageInput

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(MessageInput?)

public bool Equals(MessageInput? other)

Parameters

other MessageInput?

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(MessageInput?)

public bool Equals(MessageInput? other)

Parameters

other MessageInput?

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object?

Returns

bool

Equals(MessageInput?)

public bool Equals(MessageInput? other)

Parameters

other MessageInput?

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetHashCode()

public override int GetHashCode()

Returns

int

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

ToString()

public override string ToString()

Returns

string

ToString()

public override string ToString()

Returns

string

Operators

operator ==(MessageInput?, MessageInput?)

public static bool operator ==(MessageInput? left, MessageInput? right)

Parameters

left MessageInput?
right MessageInput?

Returns

bool

operator ==(MessageInput?, MessageInput?)

public static bool operator ==(MessageInput? left, MessageInput? right)

Parameters

left MessageInput?
right MessageInput?

Returns

bool

operator ==(MessageInput?, MessageInput?)

public static bool operator ==(MessageInput? left, MessageInput? right)

Parameters

left MessageInput?
right MessageInput?

Returns

bool

operator !=(MessageInput?, MessageInput?)

public static bool operator !=(MessageInput? left, MessageInput? right)

Parameters

left MessageInput?
right MessageInput?

Returns

bool

operator !=(MessageInput?, MessageInput?)

public static bool operator !=(MessageInput? left, MessageInput? right)

Parameters

left MessageInput?
right MessageInput?

Returns

bool

operator !=(MessageInput?, MessageInput?)

public static bool operator !=(MessageInput? left, MessageInput? right)

Parameters

left MessageInput?
right MessageInput?

Returns

bool