sharp-chat/SharpChat/Events/UserDisconnectEvent.cs

35 lines
947 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 BasicUser Sender { get; set; }
[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() { }
2023-02-16 22:47:30 +00:00
public UserDisconnectEvent(DateTimeOffset parted, BasicUser 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;
}
}
}