sharp-chat/SharpChat.Common/Messages/Storage/MemoryMessageUser.cs

31 lines
989 B
C#
Raw Permalink Normal View History

2022-08-30 15:05:29 +00:00
using SharpChat.Events;
using SharpChat.Users;
namespace SharpChat.Messages.Storage {
public class MemoryMessageUser : IUser {
public long UserId { get; }
public string UserName { get; }
public Colour Colour { get; }
public int Rank { get; }
public string NickName { get; }
public UserPermissions Permissions { get; }
public UserStatus Status => UserStatus.Unknown;
public string StatusMessage => string.Empty;
public MemoryMessageUser(MessageCreateEvent mce) {
UserId = mce.UserId;
UserName = mce.UserName;
Colour = mce.UserColour;
Rank = mce.UserRank;
NickName = mce.UserNickName;
Permissions = mce.UserPermissions;
}
public bool Equals(IUser other)
=> other != null && other.UserId == UserId;
public override string ToString()
=> $@"<MemoryMessageUser {UserId}#{UserName}>";
}
}