|
|
@ -13,7 +13,7 @@ func GetOldLevel(s *discordgo.Session, id string) (int, error) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return 0, fmt.Errorf("roles: EligibleGachaCount: error fetching guild member (%s): %w", id, err)
|
|
|
|
return 0, fmt.Errorf("roles: EligibleGachaCount: error fetching guild member (%s): %w", id, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var foundLevel = 0
|
|
|
|
foundLevel := 0
|
|
|
|
levelSearchLoop:
|
|
|
|
levelSearchLoop:
|
|
|
|
for i := len(rolesFromLevel); i > 0; i-- {
|
|
|
|
for i := len(rolesFromLevel); i > 0; i-- {
|
|
|
|
for _, v := range member.Roles {
|
|
|
|
for _, v := range member.Roles {
|
|
|
@ -23,8 +23,5 @@ levelSearchLoop:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if foundLevel == 0 {
|
|
|
|
|
|
|
|
return 0, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return foundLevel, nil
|
|
|
|
return foundLevel, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|