feat(arabot): add nvAccess to fetchRoles

This commit is contained in:
smyalygames 2023-02-20 13:09:11 +00:00
parent ed3a2719f2
commit 4c5e0238b8
4 changed files with 2 additions and 7 deletions

View File

@ -173,9 +173,6 @@ export class UnRestrictCommand extends Command {
if (await checkActive(userId)) {
const roles = await fetchRoles(userId);
if (roles.includes(IDs.roles.vegan.vegan)) {
roles.push(IDs.roles.vegan.nvAccess);
}
await member.roles.add(roles);
// Unrestricts the user on the database
await unRestrict(userId, modId);

View File

@ -37,10 +37,6 @@ export class RolesJoinServerListener extends Listener {
const roles = await fetchRoles(member.id);
if (roles.includes(IDs.roles.vegan.vegan)) {
roles.push(IDs.roles.vegan.nvAccess);
}
// Check if the user is restricted
if (await checkActive(member.id)) {
const section = await getSection(member.id);

View File

@ -126,6 +126,7 @@ export class VerificationJoinVCListener extends Listener {
// Remove all roles from the user
await member.roles.remove([
IDs.roles.vegan.vegan,
IDs.roles.vegan.nvAccess,
IDs.roles.trusted,
IDs.roles.nonvegan.nonvegan,
IDs.roles.nonvegan.convinced,

View File

@ -158,6 +158,7 @@ export async function fetchRoles(userId: Snowflake) {
}
if (roleQuery.vegan) {
roles.push(IDs.roles.vegan.vegan);
roles.push(IDs.roles.vegan.nvAccess);
}
if (roleQuery.trusted) {
roles.push(IDs.roles.trusted);