updating msg for rankCheck for proper null detection of discordId

This commit is contained in:
Sean "Solao Bajiuik" Stoves 2020-08-06 21:58:29 -04:00
parent 59525c4c63
commit 082e7a0741

View File

@ -28,6 +28,8 @@ namespace ChaosBot.Discord.Modules.Admin
{
try
{
await Context.Channel.TriggerTypingAsync();
List<LodestoneRank> ranks = await GetRank();
var sb = new StringBuilder();
@ -44,7 +46,7 @@ namespace ChaosBot.Discord.Modules.Admin
foreach (var lsID in ranks.FindAll(x => x.IngameRole == ERole.Recruit))
{
if ((lsID.ShouldBeRole != lsID.IngameRole) && (lsID.ShouldBeRole != null))
sb.AppendLine(string.Format("{0} {1}", lsID.DisplayName, $"linked to <@{lsID.DiscordId}>"));
sb.AppendLine(string.Format("{0} {1}", lsID.DisplayName, (lsID.DiscordId != null ? $"linked to <@{lsID.DiscordId}>)" : "")));
}
}
else
@ -57,7 +59,7 @@ namespace ChaosBot.Discord.Modules.Admin
foreach (var lsID in ranks.FindAll(x => x.IngameRole == ERole.Initiate))
{
if ((lsID.ShouldBeRole != lsID.IngameRole) && (lsID.ShouldBeRole != null))
sb.AppendLine(string.Format("{0} {1}", lsID.DisplayName, $"linked to <@{lsID.DiscordId}>"));
sb.AppendLine(string.Format("{0} {1}", lsID.DisplayName, (lsID.DiscordId != null ? $"linked to <@{lsID.DiscordId}>)" : "")));
}
}
else