diff --git a/DiscordChatExporter.Core/Discord/Data/Invite.cs b/DiscordChatExporter.Core/Discord/Data/Invite.cs index a9e4cb5..a73db9f 100644 --- a/DiscordChatExporter.Core/Discord/Data/Invite.cs +++ b/DiscordChatExporter.Core/Discord/Data/Invite.cs @@ -8,7 +8,7 @@ namespace DiscordChatExporter.Core.Discord.Data; // https://discord.com/developers/docs/resources/invite#invite-object public record Invite( string Code, - Guild? Guild, + Guild Guild, Channel? Channel) { public static string? TryGetCodeFromUrl(string url) => @@ -17,7 +17,7 @@ public record Invite( public static Invite Parse(JsonElement json) { var code = json.GetProperty("code").GetNonWhiteSpaceString(); - var guild = json.GetPropertyOrNull("guild")?.Pipe(Guild.Parse); + var guild = json.GetPropertyOrNull("guild")?.Pipe(Guild.Parse) ?? Guild.DirectMessages; var channel = json.GetPropertyOrNull("channel")?.Pipe(c => Channel.Parse(c)); return new Invite(code, guild, channel); diff --git a/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml b/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml index 00b2417..44d8b75 100644 --- a/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml @@ -329,15 +329,15 @@