2022-08-30 15:00:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace SharpChat.Events {
|
|
|
|
|
public class ChatMessage : IChatMessage {
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public BasicUser Sender { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public IPacketTarget Target { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public string TargetName { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public DateTimeOffset DateTime { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public ChatMessageFlags Flags { get; set; } = ChatMessageFlags.None;
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public long SequenceId { get; set; }
|
|
|
|
|
|
2023-02-08 03:17:07 +00:00
|
|
|
|
[JsonPropertyName("text")]
|
2022-08-30 15:00:58 +00:00
|
|
|
|
public string Text { get; set; }
|
|
|
|
|
|
|
|
|
|
public static string PackBotMessage(int type, string id, params string[] parts) {
|
|
|
|
|
return type.ToString() + '\f' + id + '\f' + string.Join('\f', parts);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|