discord: proper support for discriminator-less

names with no discriminator are shown as @username, and search works
with the @ too. Also bumped go version to 1.20, since it was stuck on
1.16 and i felt like trying generics (in an ugly way).
This commit is contained in:
Harvey Tindall
2023-06-12 16:32:40 +01:00
parent 6564df8082
commit 48403ce940
6 changed files with 97 additions and 181 deletions
+1 -1
View File
@@ -687,7 +687,7 @@ func (app *appContext) DiscordGetUsers(gc *gin.Context) {
resp := DiscordUsersDTO{Users: make([]DiscordUserDTO, len(users))}
for i, u := range users {
resp.Users[i] = DiscordUserDTO{
Name: u.User.Username + "#" + u.User.Discriminator,
Name: RenderDiscordUsername(u.User),
ID: u.User.ID,
AvatarURL: u.User.AvatarURL("32"),
}