26 lines
733 B
C#
26 lines
733 B
C#
using System;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace SharpChat.Events {
|
|
[ChatEventDataFor("user:kickban")]
|
|
public class UserKickBanEventData : ChatEventData {
|
|
[JsonPropertyName("reason")]
|
|
public UserDisconnectReason Reason { get; }
|
|
|
|
[JsonPropertyName("expires")]
|
|
public DateTimeOffset Expires { get; }
|
|
|
|
public UserKickBanEventData(
|
|
UserDisconnectReason reason,
|
|
DateTimeOffset expires
|
|
) {
|
|
Reason = reason;
|
|
Expires = expires;
|
|
}
|
|
|
|
public UserKickBanEventData(
|
|
UserDisconnectReason reason,
|
|
TimeSpan duration
|
|
) : this(reason, DateTimeOffset.UtcNow.Add(duration)) {}
|
|
}
|
|
}
|