feat: add support for new usernames

user discriminators become "0" if the user has a new username, distinct from "0000" for webhooks.
This commit is contained in:
Oliver Booth 2023-06-05 21:47:24 +01:00
parent 103e037dc8
commit 678dd914d4
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61
1 changed files with 6 additions and 0 deletions

View File

@ -77,6 +77,12 @@ public static class DiscordUserExtensions
}
#endif
if (user.Discriminator == "0")
{
// user has a new username. see: https://discord.com/blog/usernames
return user.Username;
}
return $"{user.Username}#{user.Discriminator}";
}