sharp-chat/SharpChat/Events/UserDisconnectEvent.cs

35 lines
945 B
C#
Raw Normal View History

2022-08-30 15:00:58 +00:00
using SharpChat.Packet;
using System;
using System.Text.Json.Serialization;
namespace SharpChat.Events {
public class UserDisconnectEvent : IChatEvent {
[JsonIgnore]
public DateTimeOffset DateTime { get; set; }
[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 ChatMessageFlags Flags { get; set; } = ChatMessageFlags.Log;
[JsonIgnore]
public long SequenceId { get; set; }
[JsonPropertyName("reason")]
2022-08-30 15:00:58 +00:00
public UserDisconnectReason Reason { get; set; }
public UserDisconnectEvent() { }
public UserDisconnectEvent(DateTimeOffset parted, ChatUser user, ChatChannel channel, UserDisconnectReason reason) {
2022-08-30 15:00:58 +00:00
DateTime = parted;
Sender = user;
2023-02-16 22:47:30 +00:00
ChannelName = channel.Name;
2022-08-30 15:00:58 +00:00
Reason = reason;
}
}
}