Explorar o código

Handle usernames properly in bridge state remote name

Tulir Asokan %!s(int64=2) %!d(string=hai) anos
pai
achega
c449696120
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      user.go

+ 3 - 0
user.go

@@ -74,6 +74,9 @@ func (user *User) GetRemoteID() string {
 
 func (user *User) GetRemoteName() string {
 	if user.Session != nil && user.Session.State != nil && user.Session.State.User != nil {
+		if user.Session.State.User.Discriminator == "0" {
+			return fmt.Sprintf("@%s", user.Session.State.User.Username)
+		}
 		return fmt.Sprintf("%s#%s", user.Session.State.User.Username, user.Session.State.User.Discriminator)
 	}
 	return user.DiscordID