|
|
|
@ -62,3 +62,19 @@ func getPrestige(dg *discordgo.Session, discordID string) int {
|
|
|
|
|
prestigeCache[discordID] = 1
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func cleanUpRole(s *discordgo.Session, discordID string) {
|
|
|
|
|
member, err := s.GuildMember(guildID, discordID)
|
|
|
|
|
if err != nil {
|
|
|
|
|
logError(s, "cleanUpRole", "guildMember", discordID)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
for _, v := range member.Roles {
|
|
|
|
|
for _, w := range rolesFromLevel {
|
|
|
|
|
if v == w {
|
|
|
|
|
s.GuildMemberRoleRemove(guildID, discordID, v)
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|