mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
27 lines
689 B
C#
27 lines
689 B
C#
#nullable disable
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace NadekoBot.Modules.Nsfw.Common;
|
|
|
|
public class SankakuImageObject : IImageData
|
|
{
|
|
public class Tag
|
|
{
|
|
public string Name { get; set; }
|
|
}
|
|
|
|
[JsonPropertyName("file_url")]
|
|
public string FileUrl { get; set; }
|
|
|
|
[JsonPropertyName("file_type")]
|
|
public string FileType { get; set; }
|
|
|
|
public Tag[] Tags { get; set; }
|
|
|
|
[JsonPropertyName("total_score")]
|
|
public int Score { get; set; }
|
|
|
|
public ImageData ToCachedImageData(Nsfw.Common.Booru type)
|
|
=> new(FileUrl, Nsfw.Common.Booru.Sankaku, Tags.Select(x => x.Name).ToArray(), Score.ToString());
|
|
}
|