|
|
@ -17,7 +17,7 @@ func QueueRoles(dg *discordgo.Session) {
|
|
|
|
for {
|
|
|
|
for {
|
|
|
|
time.Sleep(5 * time.Second)
|
|
|
|
time.Sleep(5 * time.Second)
|
|
|
|
for guildID, v := range ShouldCheck {
|
|
|
|
for guildID, v := range ShouldCheck {
|
|
|
|
for userID, _ := range v {
|
|
|
|
for userID := range v {
|
|
|
|
rank, _ := GetLevelFromXP(db.GetXP(userID))
|
|
|
|
rank, _ := GetLevelFromXP(db.GetXP(userID))
|
|
|
|
AssignRoles(dg, guildID, userID, rank)
|
|
|
|
AssignRoles(dg, guildID, userID, rank)
|
|
|
|
delete(v, userID)
|
|
|
|
delete(v, userID)
|
|
|
@ -46,6 +46,10 @@ OuterLoop:
|
|
|
|
continue OuterLoop
|
|
|
|
continue OuterLoop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dg.GuildMemberRoleAdd(guildID, userID, Roles[i])
|
|
|
|
err := dg.GuildMemberRoleAdd(guildID, userID, Roles[i])
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
util.ReportError(dg, err)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|