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

    Class ChatMessageSerializer

    Serializer for chat messages with binary data.

    Inheritance
    System.Object
    ChatMessageSerializer
    Implements
    IMessageSerializer
    Namespace: TehGM.Wolfringo.Messages.Serialization
    Assembly: Wolfringo.Core.dll
    Syntax
    public class ChatMessageSerializer : IMessageSerializer
    Remarks

    This special serializer populates chat message's binary data collection when serializing. When deserializing, it inserts data placeholders into payload body object, and adds it to serialized message's binary data.

    Constructors

    | Improve this Doc View Source

    ChatMessageSerializer()

    Initializes a new serializer for chat messages.

    Declaration
    public ChatMessageSerializer()
    Remarks

    This uses default ChatEmbedDeserializer for deserializing embeds.

    | Improve this Doc View Source

    ChatMessageSerializer(IChatEmbedDeserializer)

    Initializes a new serializer for chat messages.

    Declaration
    public ChatMessageSerializer(IChatEmbedDeserializer chatEmbedDeserializer)
    Parameters
    Type Name Description
    IChatEmbedDeserializer chatEmbedDeserializer

    Deserializer of chat embeds to use.

    Methods

    | Improve this Doc View Source

    Deserialize(String, SerializedMessageData)

    Deserializes a message.

    Declaration
    public IWolfMessage Deserialize(string eventName, SerializedMessageData messageData)
    Parameters
    Type Name Description
    System.String eventName

    Message command.

    SerializedMessageData messageData

    Serialized message data.

    Returns
    Type Description
    IWolfMessage

    Deserialized message.

    | Improve this Doc View Source

    GetMessageType(JToken)

    Determines which type of chat message it is.

    Declaration
    public static Type GetMessageType(JToken messageBody)
    Parameters
    Type Name Description
    Newtonsoft.Json.Linq.JToken messageBody

    Raw body object of the message payload.

    Returns
    Type Description
    System.Type

    Type of the chat message.

    | Improve this Doc View Source

    Serialize(IWolfMessage)

    Serializes a message.

    Declaration
    public SerializedMessageData Serialize(IWolfMessage message)
    Parameters
    Type Name Description
    IWolfMessage message

    Message to serialize.

    Returns
    Type Description
    SerializedMessageData

    Serialized message data.

    Implements

    IMessageSerializer