Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class ChatMessage

    A normal chat message.

    Inheritance
    System.Object
    ChatMessage
    Implements
    IChatMessage
    IWolfMessage
    IRawDataMessage
    IChatEmbedContainer
    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 Source

    ChatMessage()

    Creates a message instance.

    Declaration
    [JsonConstructor]
    protected ChatMessage()
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 Source

    EditInfo

    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>
    | Improve this Doc View Source

    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>
    | Improve this Doc View Source

    EventName

    Message event name.

    Declaration
    [JsonIgnore]
    public string EventName { get; }
    Property Value
    Type Description
    System.String
    Remarks

    Equals to MessageSend.

    | Improve this Doc View Source

    FlightID

    WOLF protocol internal flight ID.

    Declaration
    public string FlightID { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    HasTips

    Is this message tipped?

    Declaration
    [JsonProperty("isTipped", DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)]
    public bool HasTips { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ID

    Unique ID of the message.

    Declaration
    public Guid? ID { get; }
    Property Value
    Type Description
    System.Nullable<System.Guid>
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    IsGroupMessage

    Is it a group message?

    Declaration
    public bool IsGroupMessage { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsImage

    Is it an image message?

    Declaration
    [JsonIgnore]
    public bool IsImage { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsPrivateMessage

    Is it a private message?

    Declaration
    [JsonIgnore]
    public bool IsPrivateMessage { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsText

    Is it a text message?

    Declaration
    [JsonIgnore]
    public bool IsText { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsVoice

    Is it a voice message?

    Declaration
    [JsonIgnore]
    public bool IsVoice { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    MimeType

    Type of the message.

    Declaration
    public string MimeType { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    RawData

    Message's raw binary data.

    Declaration
    [JsonIgnore]
    public IReadOnlyCollection<byte> RawData { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyCollection<System.Byte>
    | Improve this Doc View Source

    RecipientID

    User or group that received the message.

    Declaration
    public uint RecipientID { get; }
    Property Value
    Type Description
    System.UInt32
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    Text

    Message's text.

    Declaration
    [JsonIgnore]
    public string Text { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    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.

    Implements

    IChatMessage
    IWolfMessage
    IRawDataMessage
    IChatEmbedContainer

    Extension Methods

    ChatMessageExtensions.MatchesPrefixRequirement(ChatMessage, String, PrefixRequirement, Boolean, out Int32)
    ChatMessageExtensions.MatchesPrefixRequirement(ChatMessage, ICommandOptions, out Int32)
    ChatMessageExtensions.GetMessageWithoutPrefix(ChatMessage, String, Boolean)
    ChatMessageExtensions.GetMessageWithoutPrefix(ChatMessage, ICommandOptions)
    SerializationHelper.SerializeJsonPayload<T>(T, JsonSerializer)

    See Also

    GroupActionChatEvent