Allow empty names in interactions

This commit is contained in:
Tyrrrz
2023-10-22 19:22:51 +03:00
parent 80b59d1254
commit 7b7df564ed

View File

@@ -10,7 +10,7 @@ public record Interaction(Snowflake Id, string Name, User User)
public static Interaction Parse(JsonElement json)
{
var id = json.GetProperty("id").GetNonWhiteSpaceString().Pipe(Snowflake.Parse);
var name = json.GetProperty("name").GetNonWhiteSpaceString();
var name = json.GetProperty("name").GetNonNullString(); // may be empty, but not null
var user = json.GetProperty("user").Pipe(User.Parse);
return new Interaction(id, name, user);