mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
backport of public nsfw module
This commit is contained in:
27
src/NadekoBot/Modules/Nsfw/Common/SankakuImageObject.cs
Normal file
27
src/NadekoBot/Modules/Nsfw/Common/SankakuImageObject.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Linq;
|
||||
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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user