Skip to content

Commit

Permalink
[Library -> Extensions] Refactor GetFullUsername extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogFeelings committed Feb 17, 2024
1 parent b507d99 commit 81c32d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/SammBot.Library/Extensions/UserExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ public static class UserExtensions
/// <returns>The user's formatted username.</returns>
public static string GetFullUsername(this IUser user)
{
if (!user.HasPomelo())
return $"{user.Username}#{user.Discriminator}";
string formattedUsername = user.ToString()!;

return $"@{user.Username}";
if (user.HasPomelo())
return $"@{formattedUsername}";

return formattedUsername;
}

/// <summary>
Expand Down

0 comments on commit 81c32d4

Please sign in to comment.