From 1491f7fd868e2a0aeaee39da15bacd27e80567aa Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 27 Aug 2023 17:00:30 +0100 Subject: [PATCH] style: surround bot names with [ ] --- VPLink.Common/Extensions/UserExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VPLink.Common/Extensions/UserExtensions.cs b/VPLink.Common/Extensions/UserExtensions.cs index fcb5977..868beb0 100644 --- a/VPLink.Common/Extensions/UserExtensions.cs +++ b/VPLink.Common/Extensions/UserExtensions.cs @@ -15,11 +15,13 @@ public static class UserExtensions /// is null. public static string GetDisplayName(this IUser user) { - return user switch + string displayName = user switch { null => throw new ArgumentNullException(nameof(user)), IGuildUser member => member.Nickname ?? member.GlobalName ?? member.Username, _ => user.GlobalName ?? user.Username }; + + return user.IsBot ? $"[{displayName}]" : displayName; } }