|
|
@ -7,7 +7,12 @@ using JsonExtensions.Reading;
|
|
|
|
namespace DiscordChatExporter.Core.Discord.Data;
|
|
|
|
namespace DiscordChatExporter.Core.Discord.Data;
|
|
|
|
|
|
|
|
|
|
|
|
// https://discord.com/developers/docs/resources/sticker#sticker-resource
|
|
|
|
// https://discord.com/developers/docs/resources/sticker#sticker-resource
|
|
|
|
public record Sticker(Snowflake Id, string Name, StickerFormat Format, string SourceUrl)
|
|
|
|
public partial record Sticker(Snowflake Id, string Name, StickerFormat Format, string SourceUrl)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public bool IsImage => Format != StickerFormat.Lottie;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public partial record Sticker
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public static Sticker Parse(JsonElement json)
|
|
|
|
public static Sticker Parse(JsonElement json)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -22,6 +27,7 @@ public record Sticker(Snowflake Id, string Name, StickerFormat Format, string So
|
|
|
|
StickerFormat.Png => "png",
|
|
|
|
StickerFormat.Png => "png",
|
|
|
|
StickerFormat.Apng => "png",
|
|
|
|
StickerFormat.Apng => "png",
|
|
|
|
StickerFormat.Lottie => "json",
|
|
|
|
StickerFormat.Lottie => "json",
|
|
|
|
|
|
|
|
StickerFormat.Gif => "gif",
|
|
|
|
_ => throw new InvalidOperationException($"Unknown sticker format '{format}'.")
|
|
|
|
_ => throw new InvalidOperationException($"Unknown sticker format '{format}'.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|