sharp-chat/SharpChat/Events/ChatMessage.cs

29 lines
776 B
C#
Raw Normal View History

2022-08-30 15:00:58 +00:00
using System;
using System.Text.Json.Serialization;
namespace SharpChat.Events {
public class ChatMessage : IChatMessage {
[JsonIgnore]
public ChatUser Sender { get; set; }
2022-08-30 15:00:58 +00:00
[JsonIgnore]
2023-02-16 22:47:30 +00:00
public string ChannelName { get; set; }
2022-08-30 15:00:58 +00:00
[JsonIgnore]
public DateTimeOffset DateTime { get; set; }
[JsonIgnore]
public ChatMessageFlags Flags { get; set; } = ChatMessageFlags.None;
[JsonIgnore]
public long SequenceId { get; set; }
[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);
}
}
}