Class ChatMessage
A normal chat message.
Inheritance
Namespace: TehGM.Wolfringo.Messages
Assembly: Wolfringo.Core.dll
Syntax
[ResponseType(typeof(ChatResponse))]
public class ChatMessage : IChatMessage, IWolfMessage, IRawDataMessage, IChatEmbedContainer
Remarks
Uses ChatResponse as response type.
Constructors
| Improve this Doc View SourceChatMessage()
Creates a message instance.
Declaration
[JsonConstructor]
protected ChatMessage()
ChatMessage(UInt32, Boolean, String, IEnumerable<Byte>)
Creates a message instance.
Declaration
public ChatMessage(uint recipientID, bool groupMessage, string type, IEnumerable<byte> data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | recipientID | User or group ID to send the message to. |
| System.Boolean | groupMessage | Is recipient a group? |
| System.String | type | Mime type of the message. |
| System.Collections.Generic.IEnumerable<System.Byte> | data | Raw byte data of the message. |
ChatMessage(UInt32, Boolean, String, IEnumerable<Byte>, ChatMessageFormatting)
Creates a message instance.
Declaration
public ChatMessage(uint recipientID, bool groupMessage, string type, IEnumerable<byte> data, ChatMessageFormatting formattingMetadata)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | recipientID | User or group ID to send the message to. |
| System.Boolean | groupMessage | Is recipient a group? |
| System.String | type | Mime type of the message. |
| System.Collections.Generic.IEnumerable<System.Byte> | data | Raw byte data of the message. |
| ChatMessageFormatting | formattingMetadata | Metadata for message formatting, such as group links. |
ChatMessage(UInt32, Boolean, String, IEnumerable<Byte>, ChatMessageFormatting, IEnumerable<IChatEmbed>)
Creates a message instance.
Declaration
public ChatMessage(uint recipientID, bool groupMessage, string type, IEnumerable<byte> data, ChatMessageFormatting formattingMetadata, IEnumerable<IChatEmbed> embeds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | recipientID | User or group ID to send the message to. |
| System.Boolean | groupMessage | Is recipient a group? |
| System.String | type | Mime type of the message. |
| System.Collections.Generic.IEnumerable<System.Byte> | data | Raw byte data of the message. |
| ChatMessageFormatting | formattingMetadata | Metadata for message formatting, such as group links. |
| System.Collections.Generic.IEnumerable<IChatEmbed> | embeds | Visual embeds attached to this chat message. |
Properties
| Improve this Doc View SourceEditInfo
Information about message's latest edit.
Declaration
[JsonProperty("edited", NullValueHandling = NullValueHandling.Ignore)]
public ChatMessage.EditMetadata? EditInfo { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<ChatMessage.EditMetadata> |
Embeds
Visual embeds attached to this chat message.
Declaration
[JsonProperty("embeds", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
public IEnumerable<IChatEmbed> Embeds { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<IChatEmbed> |
EventName
Message event name.
Declaration
[JsonIgnore]
public string EventName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Equals to MessageSend.
FlightID
WOLF protocol internal flight ID.
Declaration
public string FlightID { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FormattingMetadata
The metadata for formatting of links in the message text.
Declaration
[JsonProperty("formatting", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
public ChatMessageFormatting FormattingMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ChatMessageFormatting |
HasTips
Is this message tipped?
Declaration
[JsonProperty("isTipped", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
public bool HasTips { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ID
Unique ID of the message.
Declaration
public Guid? ID { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Guid> |
IsDeleted
Is this message soft-deleted by group admin?
Declaration
[JsonProperty("isDeleted", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
public bool IsDeleted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsGroupMessage
Is it a group message?
Declaration
public bool IsGroupMessage { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsImage
Is it an image message?
Declaration
[JsonIgnore]
public bool IsImage { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsPrivateMessage
Is it a private message?
Declaration
[JsonIgnore]
public bool IsPrivateMessage { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsText
Is it a text message?
Declaration
[JsonIgnore]
public bool IsText { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsVoice
Is it a voice message?
Declaration
[JsonIgnore]
public bool IsVoice { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
MimeType
Type of the message.
Declaration
public string MimeType { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
RawData
Message's raw binary data.
Declaration
[JsonIgnore]
public IReadOnlyCollection<byte> RawData { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyCollection<System.Byte> |
RecipientID
User or group that received the message.
Declaration
public uint RecipientID { get; }
Property Value
| Type | Description |
|---|---|
| System.UInt32 |
SenderID
User that sent the message.
Declaration
public uint? SenderID { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
Remarks
When creating a new chat message, this value will be null.
For received messages, this value will be populated normally.
Text
Message's text.
Declaration
[JsonIgnore]
public string Text { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Timestamp
Message's timestamp.
Declaration
public WolfTimestamp? Timestamp { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<WolfTimestamp> |
Remarks
When creating a new chat message, this value will be null. Once WOLF server acknowledges the message, it'll respond with timestamp value. Default WolfClient implementation will automatically populate this value once this happens, so message will have timestamp populated after SendAsync<TResponse>(IWolfMessage, CancellationToken) returns.
For received messages, this value will be populated normally.