Disforget/Model.cs

47 lines
1.1 KiB
C#
Raw Normal View History

2023-02-22 22:03:01 +01:00
using System.Text.Json.Serialization;
namespace Disforget;
public record Response
{
[JsonPropertyName("total_results")]
public int TotalResults { get; set; }
[JsonPropertyName("messages")]
2023-02-23 10:27:59 +01:00
public IEnumerable<IEnumerable<Message>> MessagesInternal { get; set; } = Array.Empty<IEnumerable<Message>>();
2023-02-22 22:03:01 +01:00
[JsonIgnore]
public ICollection<Message> Messages => MessagesInternal.Select(m => m.First()).ToList();
}
public record Message
{
[JsonPropertyName("id")]
public ulong Id { get; set; }
[JsonPropertyName("channel_id")]
public ulong ChannelId { get; set; }
[JsonPropertyName("content")]
public string Content { get; set; } = null!;
}
public record IdChn
{
[JsonPropertyName("id")]
public ulong Id { get; set; }
[JsonPropertyName("chn")]
public ulong Channel { get; set; }
}
2023-02-23 10:27:59 +01:00
public class UserData
{
[JsonPropertyName("token")]
public string Token { get; set; } = "";
[JsonPropertyName("cfcookie")]
public string Cookie { get; set; } = "";
[JsonPropertyName("type")]
public string Type { get; set; } = "DM";
[JsonPropertyName("myId")]
public ulong UserId { get; set; }
}