diff --git a/EliteBGS/DiscordLogGenerator.cs b/EliteBGS/DiscordLogGenerator.cs index 12cfc45..99d1188 100644 --- a/EliteBGS/DiscordLogGenerator.cs +++ b/EliteBGS/DiscordLogGenerator.cs @@ -34,9 +34,18 @@ public class DiscordLogGenerator { protected virtual string GenerateObjectiveHeader(Objective objective) { StringBuilder log = new StringBuilder(); + string location; + + if (!string.IsNullOrEmpty(objective.System) && !string.IsNullOrEmpty(objective.Faction)) { + location = string.Format("{0}, {1}", objective.System, objective.Faction); + } else if (!string.IsNullOrEmpty(objective.System)) { + location = objective.System; + } else { + location = "Unknown Location"; + } + log.AppendFormat("**Date:** {0}\n", DateTime.Now.ToString("dd/MM/yyyy")); - log.AppendFormat("**Location:** {0}, {1}\n", objective.System, objective.Faction); - log.AppendFormat("**Faction:** {0}\n", objective.Faction); + log.AppendFormat("**Target:** {0}\n", location); log.AppendLine(""); log.AppendLine("```"); diff --git a/EliteBGS/NonaDiscordLog.cs b/EliteBGS/NonaDiscordLog.cs index 603d679..789ff6d 100644 --- a/EliteBGS/NonaDiscordLog.cs +++ b/EliteBGS/NonaDiscordLog.cs @@ -34,7 +34,17 @@ public class NonaDiscordLog : DiscordLogGenerator { protected override string GenerateObjectiveHeader(Objective objective) { StringBuilder log = new StringBuilder(); - log.AppendFormat(":globe_with_meridians: `Location:` {0}, {1}\n", objective.System, objective.Faction); + string location; + + if (!string.IsNullOrEmpty(objective.System) && !string.IsNullOrEmpty(objective.Faction)) { + location = string.Format("{0}, {1}", objective.System, objective.Faction); + } else if (!string.IsNullOrEmpty(objective.System)) { + location = objective.System; + } else { + location = "Unknown Location"; + } + + log.AppendFormat(":globe_with_meridians: `Target:` {0}\n", location); log.Append(":clipboard: `Conducted:`\n"); log.Append("```");