|
|
|
@ -7,10 +7,14 @@ import (
|
|
|
|
|
"PermissionGacha/modules/log"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func GiveLevelRoles(s *discordgo.Session, discordID string, oldLevel, newLevel int) {
|
|
|
|
|
func GiveLevelRoles(s *discordgo.Session, discordID string, oldLevel, newLevel int) error {
|
|
|
|
|
for i := oldLevel + 1; i <= newLevel; i++ {
|
|
|
|
|
s.GuildMemberRoleAdd(config.GuildID, discordID, config.LevelRoles[i-1])
|
|
|
|
|
err := s.GuildMemberRoleAdd(config.GuildID, discordID, config.LevelRoles[i-1])
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func RemoveAllLevelRoles(s *discordgo.Session, discordID string) {
|
|
|
|
|