46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
|
using System;
|
|||
|
|
|||
|
namespace SharpChat.Events {
|
|||
|
public class ChatEventInfo {
|
|||
|
public long Id { get; }
|
|||
|
public string Type { get; }
|
|||
|
public DateTimeOffset Created { get; }
|
|||
|
public string ChannelName { get; }
|
|||
|
public long SenderId { get; }
|
|||
|
public string SenderName { get; }
|
|||
|
public Colour SenderColour { get; }
|
|||
|
public int SenderRank { get; }
|
|||
|
public string? SenderNickName { get; }
|
|||
|
public UserPermissions SenderPerms { get; }
|
|||
|
public ChatEventData Data { get; }
|
|||
|
|
|||
|
public bool IsBroadcast => string.IsNullOrWhiteSpace(ChannelName);
|
|||
|
|
|||
|
public ChatEventInfo(
|
|||
|
long id,
|
|||
|
string type,
|
|||
|
DateTimeOffset created,
|
|||
|
string channelName,
|
|||
|
long senderId,
|
|||
|
string senderName,
|
|||
|
Colour senderColour,
|
|||
|
int senderRank,
|
|||
|
string? senderNickName,
|
|||
|
UserPermissions senderPerms,
|
|||
|
ChatEventData? data = null
|
|||
|
) {
|
|||
|
Id = id;
|
|||
|
Type = type;
|
|||
|
Created = created;
|
|||
|
ChannelName = channelName;
|
|||
|
SenderId = senderId;
|
|||
|
SenderName = senderName;
|
|||
|
SenderColour = senderColour;
|
|||
|
SenderRank = senderRank;
|
|||
|
SenderNickName = senderNickName;
|
|||
|
SenderPerms = senderPerms;
|
|||
|
Data = data ?? ChatEventData.EmptyInstance;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|