|
|
@ -67,16 +67,14 @@ public partial record Channel
|
|
|
|
var name =
|
|
|
|
var name =
|
|
|
|
// Guild channel
|
|
|
|
// Guild channel
|
|
|
|
json.GetPropertyOrNull("name")?.GetNonWhiteSpaceStringOrNull()
|
|
|
|
json.GetPropertyOrNull("name")?.GetNonWhiteSpaceStringOrNull()
|
|
|
|
??
|
|
|
|
|
|
|
|
// DM channel
|
|
|
|
// DM channel
|
|
|
|
json.GetPropertyOrNull("recipients")
|
|
|
|
?? json.GetPropertyOrNull("recipients")
|
|
|
|
?.EnumerateArrayOrNull()
|
|
|
|
?.EnumerateArrayOrNull()
|
|
|
|
?.Select(User.Parse)
|
|
|
|
?.Select(User.Parse)
|
|
|
|
.Select(u => u.DisplayName)
|
|
|
|
.Select(u => u.DisplayName)
|
|
|
|
.Pipe(s => string.Join(", ", s))
|
|
|
|
.Pipe(s => string.Join(", ", s))
|
|
|
|
??
|
|
|
|
|
|
|
|
// Fallback
|
|
|
|
// Fallback
|
|
|
|
id.ToString();
|
|
|
|
?? id.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
var position = positionHint ?? json.GetPropertyOrNull("position")?.GetInt32OrNull();
|
|
|
|
var position = positionHint ?? json.GetPropertyOrNull("position")?.GetInt32OrNull();
|
|
|
|
|
|
|
|
|
|
|
|