The source project of this merge request has been removed.
Introduce two methods for hiding the discriminator
Description
Hide discriminators for users that no longer have them. This should fix #420 (closed)
Changes Proposed
- Adds GetUsernameClean() to UserExtensions.cs to drop the discriminator when it's 0
- Adds SanitizeUsername() to StringExtensions.cs to remove #0000 in strings where GetUsernameClean() isn't feasible
- Updates the DiscordUser ToString() method to drop the discriminator if it's 0000.
- Replaces instances of msg.author and ctx.user with msg.author.GetUsernameClean() and ctx.user.GetUsernameClean()
Details
With the discord.net library showing users without discriminators as #0000, I wanted to update how usernames are present by the bot in both logs and messages to properly reflect the new discord changes.
Screenshots
These screenshots reflect some of my bot customizations, but should not be present in this MR.
Edited by Alexandra