Luski.Net/Luski.net/Structures/Main/MainSocketDMChannel.cs

35 lines
946 B
C#
Raw Permalink Normal View History

using Luski.net.JsonTypes.BaseTypes;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading;
namespace Luski.net.Structures.Main;
public class MainSocketDMChannel : MainSocketTextChannel
{
public MainSocketRemoteUser User
{
get
{
if (_user is null)
{
var list = MemberIdList.ToList();
list.Remove(Server.User.Id);
_user = Server.GetUser<MainSocketRemoteUser>(list.FirstOrDefault(), CancellationToken.None).Result;
}
return _user;
}
}
public MainSocketRemoteUser _user = null!;
}
[JsonSerializable(typeof(MainSocketDMChannel))]
[JsonSourceGenerationOptions(
GenerationMode = JsonSourceGenerationMode.Default,
PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase,
WriteIndented = false)]
internal partial class MainSocketDMChannelContext : JsonSerializerContext
{
}