mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-21 06:11:28 +00:00
Extract thread status and improve CLI output
This commit is contained in:
@@ -12,6 +12,7 @@ public record ChannelThread(
|
||||
Snowflake GuildId,
|
||||
Snowflake ParentId,
|
||||
string Name,
|
||||
bool IsActive,
|
||||
Snowflake? LastMessageId) : IHasId
|
||||
{
|
||||
public static ChannelThread Parse(JsonElement json)
|
||||
@@ -22,6 +23,11 @@ public record ChannelThread(
|
||||
var parentId = json.GetProperty("parent_id").GetNonWhiteSpaceString().Pipe(Snowflake.Parse);
|
||||
var name = json.GetProperty("name").GetNonWhiteSpaceString();
|
||||
|
||||
var isActive = !json
|
||||
.GetPropertyOrNull("thread_metadata")?
|
||||
.GetPropertyOrNull("archived")?
|
||||
.GetBooleanOrNull() ?? true;
|
||||
|
||||
var lastMessageId = json
|
||||
.GetPropertyOrNull("last_message_id")?
|
||||
.GetNonWhiteSpaceStringOrNull()?
|
||||
@@ -33,6 +39,7 @@ public record ChannelThread(
|
||||
guildId,
|
||||
parentId,
|
||||
name,
|
||||
isActive,
|
||||
lastMessageId
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user