Class ChatLine
A single line in the chat, composed of colored segments.
public class ChatLine
- Inheritance
-
ChatLine
- Inherited Members
Constructors
ChatLine(List<ChatSegment>)
public ChatLine(List<ChatSegment> segments)
Parameters
segmentsList<ChatSegment>
ChatLine(string)
public ChatLine(string plainText)
Parameters
plainTextstring
Properties
AttachmentFileName
public string? AttachmentFileName { get; set; }
Property Value
AttachmentUrl
public string? AttachmentUrl { get; set; }
Property Value
ContinuationIndent
Number of spaces to prepend on continuation lines when this line is word-wrapped.
public int ContinuationIndent { get; set; }
Property Value
IsMention
public bool IsMention { get; set; }
Property Value
MessageId
public Guid? MessageId { get; set; }
Property Value
- Guid?
Segments
public List<ChatSegment> Segments { get; }
Property Value
- List<ChatSegment>
SenderUsername
public string? SenderUsername { get; set; }
Property Value
TextLength
public int TextLength { get; }
Property Value
Type
public MessageType? Type { get; set; }
Property Value
Methods
FromColoredText(string, Attribute?)
Parse a string containing printable color tags into colored segments. Format: {F:RRGGBB} (foreground), {B:RRGGBB} (background), {X} (reset).
public static ChatLine FromColoredText(string text, Attribute? defaultAttr = null)
Parameters
textstringdefaultAttrAttribute?
Returns
HasColorTags(string)
Returns true if a line contains printable color tags.
public static bool HasColorTags(string text)
Parameters
textstring
Returns
StripColorTags(string)
Remove all color tags from text, returning only the visible characters.
public static string StripColorTags(string text)
Parameters
textstring
Returns
ToString()
public override string ToString()
Returns
Wrap(int, int)
Wrap this line into multiple lines that fit within the given width. Continuation lines are indented with the specified number of spaces.
public List<ChatLine> Wrap(int width, int continuationIndent = 0)
Parameters
Returns
- List<ChatLine>