From 5483bbd2034c7e9e1029ab03576d8ab5ddcc11d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:09:26 +0000 Subject: [PATCH] Bump the remora group with 4 updates (#259) --- Octobot.csproj | 2 +- src/Commands/ToolsCommandGroup.cs | 4 ++-- src/Services/Update/MemberUpdateService.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Octobot.csproj b/Octobot.csproj index 1f050a6..1c2c08c 100644 --- a/Octobot.csproj +++ b/Octobot.csproj @@ -29,7 +29,7 @@ - + diff --git a/src/Commands/ToolsCommandGroup.cs b/src/Commands/ToolsCommandGroup.cs index b539355..fb87117 100644 --- a/src/Commands/ToolsCommandGroup.cs +++ b/src/Commands/ToolsCommandGroup.cs @@ -101,10 +101,10 @@ public class ToolsCommandGroup : CommandGroup { var builder = new StringBuilder().AppendLine($"### <@{target.ID}>"); - if (target.GlobalName is not null) + if (target.GlobalName.IsDefined(out var globalName)) { builder.AppendBulletPointLine(Messages.UserInfoDisplayName) - .AppendLine(Markdown.InlineCode(target.GlobalName)); + .AppendLine(Markdown.InlineCode(globalName)); } builder.AppendBulletPointLine(Messages.UserInfoDiscordUserSince) diff --git a/src/Services/Update/MemberUpdateService.cs b/src/Services/Update/MemberUpdateService.cs index 06e531f..7674bbe 100644 --- a/src/Services/Update/MemberUpdateService.cs +++ b/src/Services/Update/MemberUpdateService.cs @@ -185,7 +185,7 @@ public sealed partial class MemberUpdateService : BackgroundService { var currentNickname = member.Nickname.IsDefined(out var nickname) ? nickname - : user.GlobalName ?? user.Username; + : user.GlobalName.OrDefault(user.Username); var characterList = currentNickname.ToList(); var usernameChanged = false; foreach (var character in currentNickname)