From b3b2a16aad2a6d17fd3c64ae8133442840a8ed55 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Thu, 28 Sep 2023 23:02:09 +0500 Subject: [PATCH] Properly check for nickname presence Signed-off-by: Octol1ttle --- src/Commands/ToolsCommandGroup.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/ToolsCommandGroup.cs b/src/Commands/ToolsCommandGroup.cs index 57fe2aa..cc833c1 100644 --- a/src/Commands/ToolsCommandGroup.cs +++ b/src/Commands/ToolsCommandGroup.cs @@ -25,8 +25,8 @@ public class ToolsCommandGroup : CommandGroup { private readonly ICommandContext _context; private readonly FeedbackService _feedback; - private readonly GuildDataService _guildData; private readonly IDiscordRestGuildAPI _guildApi; + private readonly GuildDataService _guildData; private readonly IDiscordRestUserAPI _userApi; public ToolsCommandGroup( @@ -153,10 +153,10 @@ public class ToolsCommandGroup : CommandGroup private static void AppendGuildInformation(IGuildMember guildMember, StringBuilder builder) { - if (guildMember.Nickname.Value is not null) + if (guildMember.Nickname.IsDefined(out var nickname)) { builder.Append("- ").AppendLine(Messages.ShowInfoGuildNickname) - .AppendLine(Markdown.InlineCode(guildMember.Nickname.Value)); + .AppendLine(Markdown.InlineCode(nickname)); } builder.Append("- ").AppendLine(Messages.ShowInfoGuildMemberSince)