sharp-chat/SharpChatCommon/Events/UserStatusUpdateEventData.cs

18 lines
519 B
C#
Raw Normal View History

using System.Text.Json.Serialization;
namespace SharpChat.Events {
[ChatEventDataFor("user:status")]
public class UserStatusUpdateEventData : ChatEventData {
[JsonPropertyName("status")]
public UserStatus Status { get; }
[JsonPropertyName("text")]
public string? Text { get; }
public UserStatusUpdateEventData(UserStatus status, string? text = null) {
Status = status;
Text = string.IsNullOrWhiteSpace(text) ? null : text;
}
}
}