Skip to content

Reverification caused valid holders roles to be removed #2

Description

@Michael-Davies

Had an issue the other day when all valid holders had their roles removed. I think this is because of:

if (userQualifiesForRole && !discordUser.roles.cache.has(role.id)) {
        this.logger.info(`Assigning Role: ${role.name}`);
        await discordUser.roles.add(role);
      } else {
        if (discordUser.roles.cache.has(role.id)) {
          this.logger.info(`Removing Role: ${role.name}`);
          await discordUser.roles.remove(role);
        }
      }

I fixed it by changing if (discordUser.roles.cache.has(role.id)) to if (!userQualifiesForRole && discordUser.roles.cache.has(role.id))

Am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions