fix: remove role check

Signed-off-by: jolheiser <john.olheiser@gmail.com>
pull/19/head
jolheiser 2024-06-18 11:04:16 -05:00
parent 97ddafcaf6
commit b81c6f7051
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
1 changed files with 5 additions and 10 deletions

View File

@ -19,7 +19,7 @@ func init() {
commands = append(commands, &command{ commands = append(commands, &command{
name: "register", name: "register",
validate: func(cmd commandInit) bool { validate: func(cmd commandInit) bool {
return len(cmd.message.Member.Roles) <= 1 return len(cmd.message.Member.Roles) == 0
}, },
run: func(cmd commandInit) (string, error) { run: func(cmd commandInit) (string, error) {
args := strings.Fields(cmd.message.Content) args := strings.Fields(cmd.message.Content)
@ -67,17 +67,12 @@ func init() {
return "No application found for that player", nil return "No application found for that player", nil
} }
} }
} else if len(cmd.message.Member.Roles) == 0 {
if len(apps) > 0 {
if apps[0].Accepted != nil && *apps[0].Accepted {
return fmt.Sprintf("Please join the server at `%s` and then re-try this command", cmd.config.Register.URL), nil
}
} else {
return "No player or applications found for that username", nil
}
} }
accepted := apps[0].Accepted if len(apps) == 0 {
return "No player or applications found for that username", nil
}
accepted := apps[0].Accepted
if accepted == nil { if accepted == nil {
return "Your application is still being reviewed, hang tight", nil return "Your application is still being reviewed, hang tight", nil
} else if !*accepted { } else if !*accepted {