Updated Discord username validator
This commit is contained in:
@ -112,7 +112,7 @@ func (user *User) Edit(ctx aero.Context, key string, value reflect.Value, newVal
|
||||
}
|
||||
|
||||
if !validate.DiscordNick(newNick) {
|
||||
return true, errors.New("Discord username must include your name and the 4-digit Discord tag (e.g. Yandere#1234)")
|
||||
return true, errors.New("Not a valid Discord username")
|
||||
}
|
||||
|
||||
// Trim spaces
|
||||
|
@ -22,7 +22,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
discordNickRegex = regexp.MustCompile(`^([^#]{2,32})#(\d{4})$`)
|
||||
discordNickRegex = regexp.MustCompile(`^([^#]{2,32})$`)
|
||||
emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user