Fix crash when parsing position on DM channels (#496)

This commit is contained in:
Lucas LaBuff
2021-02-06 10:00:29 -05:00
committed by GitHub
parent e49cf997ea
commit a8031ad3aa
7 changed files with 17 additions and 25 deletions

View File

@@ -94,8 +94,8 @@ namespace DiscordChatExporter.Domain.Exporting
"%T" => channel.Category.Name,
"%c" => channel.Id.ToString(),
"%C" => channel.Name,
"%p" => channel.Position.ToString(),
"%P" => channel.Category.Position.ToString(),
"%p" => channel.Position?.ToString() ?? "0",
"%P" => channel.Category.Position?.ToString() ?? "0",
"%a" => (after ?? Snowflake.Zero).ToDate().ToString("yyyy-MM-dd"),
"%b" => (before?.ToDate() ?? DateTime.Now).ToString("yyyy-MM-dd"),
"%%" => "%",