mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-05 09:29:32 +00:00
Allow whitespace in sticker names
This commit is contained in:
@@ -4,6 +4,7 @@ using JsonExtensions.Reading;
|
||||
|
||||
namespace DiscordChatExporter.Core.Discord.Data;
|
||||
|
||||
// https://discord.com/developers/docs/resources/sticker#sticker-resource
|
||||
public record Sticker(Snowflake Id, string Name, StickerFormat Format, string SourceUrl)
|
||||
{
|
||||
private static string GetSourceUrl(Snowflake id, StickerFormat format)
|
||||
@@ -15,7 +16,7 @@ public record Sticker(Snowflake Id, string Name, StickerFormat Format, string So
|
||||
public static Sticker Parse(JsonElement json)
|
||||
{
|
||||
var id = json.GetProperty("id").GetNonWhiteSpaceString().Pipe(Snowflake.Parse);
|
||||
var name = json.GetProperty("name").GetNonWhiteSpaceString();
|
||||
var name = json.GetProperty("name").GetNonNullString();
|
||||
var format = (StickerFormat)json.GetProperty("format_type").GetInt32();
|
||||
|
||||
var sourceUrl = GetSourceUrl(id, format);
|
||||
|
||||
Reference in New Issue
Block a user